RussQuan / udemypy

Free Udemy courses everyday!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UdemyPy πŸ€–

UdemyPy is a bot that hourly searches for Udemy free courses and shares them on:

πŸ”Œ How does it work?

For publishing new courses, UdemyPy follows these steps:

  1. UdemyPy looks for courses at Discudemy, UdemyFreebies and TutorialBar.
  2. The courses found are compared to those previously found. A new_courses list is generated and stored into the database.
  3. new_courses are shared on social media.

This process is run hourly, everyday.

πŸ”Œ How are repeated courses detected?

Since UdemyPy scrapes different websites constantly, it must remember which courses have already been shared.
Every hour UdemyPy gets a list of free Udemy courses: courses_found. This list contains courses which haven't been shared yet and courses that have. For each course in courses_found, UdemyPy tries to add it to the database. If it fails, the course is already in the database (therefore the course has already been shared). If it success, the course is stored in a courses_added list.
Finally, the courses_added list is shared on social media.

πŸ”Œ Enviroment Variables

FILE: udemypy/udemy/bot_settings.py

PAGES_TO_SCRAPE: number of pages to scrape from Discudemy, UdemyFreebies and TutorialBar.

FILE: udemypy/database/db_data.py

CLEARDB_DATABASE_URL: url provided by Heroku ClearDB.
COURSE_LIFETIME: days a course will be stored in the database.
TABLE_NAME: name of the table where courses are stored.

FILE: udemypy/tgm/data.py

TOKEN: token to establish connection with the Telegram API.
CHANNEL_ID: Telegram channel id (could be a number or string).
CHANNEL_LINK: link shown when you click the share button from a Telegram message sent by UdemyPy.
DONATE_ME_LINK: link shown when you click the donate button from a Telegram message sent by UdemyPy.
TWITTER_LINK: link shown when you click the twitter button from a Telegram message sent by UdemyPy.

FILE: udemypy/twitter/data.py

API_KEY: key provided by Twitter to use its API.
API_KEY_SECRET: key provided by Twitter to use its API.
ACCESS_TOKEN: token provided by Twitter to use its API.
ACCESS_TOKEN_SECRET: token provided by Twitter to use its API.

About

Free Udemy courses everyday!

License:GNU General Public License v3.0


Languages

Language:Python 100.0%