Coder Social home page Coder Social logo

ugurkap / kontenjanci-public Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 29 KB

İTÜ Kontenjan İzlemcisi is a Telegram bot which users can use to track a different number of courses and get notified if there are any available seats in those courses. Only available on add-drop period.

Home Page: https://telegram.me/ITUKontenjanBot

License: GNU General Public License v3.0

Python 100.00%
telegram telegram-bot python-telegram-bot scrape scraper beautifulsoup4 scheduled-task scheduled-jobs

kontenjanci-public's Introduction

kontenjanci-public

forthebadge forthebadge forthebadge

Public version of Telegram bot "İTÜ Kontenjan İzlemcisi". (This repo doesn't include the bot token) https://telegram.me/ITUKontenjanBot

How does it work?

Istanbul Technical University updates its course information page every 15 minutes. Scraper, which is available in scraper.py, scrapes the webpage and adds a CRN(Unique course number) to a list if (course capacity > enrollment).

Then, in application.py, we have the application which uses the Scraper every 15 minutes and saves the list in a file called available_courses.txt. To do that, I am using a library called schedule.

Finally, we have bot.py which is a Telegram bot. User is able to add course numbers s/he wants and then start the "watch" which notifies the user when the course number s/he follows is added to available_courses.txt. To do that, I have used python-telegram-bot library.

kontenjanci-public's People

Contributors

ugurkap avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

kontenjanci-public's Issues

Refactor scraper.py

I've selected scraper.py for refactoring, which is a module that has 1 instance(s) of code in comments (1). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Clean Code guideline rating! 👍

Here's the gist of this guideline:

  • Definition 📖
    Apply The Boy Scout Rule and fix "code smells" in the codebase.
  • Why
    Clean code is maintainable code.
  • How 🔧
    Remove useless comments, commented code blocks, and dead code. Refactor poorly handled exceptions, magic constants, and poorly named units or variables.

You can find more info about this guideline in Building Maintainable Software. 📖


ℹ️ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the 🔲 next to them. The risk profile below the candidates signals (✅) when it's enough! 🏁


Good luck and happy coding! :shipit: ✨ 💯

Use multithreaded requests

Right now, scraper checks every webpage sequentially using a for loop and it takes almost 1 minute to update the list. Multi-threaded approach will be faster.

Refactor bot.py

I've selected bot.py for refactoring, which is a module that has 2 instance(s) of code in comments (1, 2). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Clean Code guideline rating! 👍

Here's the gist of this guideline:

  • Definition 📖
    Apply The Boy Scout Rule and fix "code smells" in the codebase.
  • Why
    Clean code is maintainable code.
  • How 🔧
    Remove useless comments, commented code blocks, and dead code. Refactor poorly handled exceptions, magic constants, and poorly named units or variables.

You can find more info about this guideline in Building Maintainable Software. 📖


ℹ️ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the 🔲 next to them. The risk profile below the candidates signals (✅) when it's enough! 🏁


Good luck and happy coding! :shipit: ✨ 💯

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.