Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add channel for comic strips #12

Open
CaptainIRS opened this issue Jan 10, 2021 · 2 comments
Open

Add channel for comic strips #12

CaptainIRS opened this issue Jan 10, 2021 · 2 comments

Comments

@CaptainIRS
Copy link
Owner

  • Add config file for comic strips
  • Write functions for configuring and updating feeds of popular comics
@vaishnavi192
Copy link

Hey @CaptainIRS I would like to work on this issue under DWOC'24 but can you plz tell a flow how to do this. We have to store data in json format, web scraping will also be used?

@CaptainIRS
Copy link
Owner Author

Hi @vaishnavi192,

The ideal flow would be: (mostly based on the logic behind how forum posts are fetched)

  1. Collect a list of comics with content related to programming/programmers/software., like XKCD, MonkeyUser, The Developer's Life, etc.
  2. Create a config file for comics in the config, folder, similar to config/forums.json, which defines the frequency of posts, name and icon of the site, etc.
  3. Create a comics/ folder in the root similar to the forums/ folder to create files to fetch the comics from the sites and process them. (Refer next step)
  4. Check if the comic has an RSS feed. To do that follow step 3 in CONTRIBUTING.md#adding-new-feeds. If there is a feed, then write the logic like forums/slashdot.py, else create something like forums/hackernews.py to scrape the site yourself and get the posts according to the frequency.
  5. Create a comics/__init__.py like forums/__init__.py to act as an interface.
  6. Create utility functions in util/embed_utils.py similar to create_forum_embed, create_forum_telegram_post and create_forum_reddit_post to convert your post to the formats recognised by Discord, Telegram and Reddit.
  7. Add a new channel for comics in main.py (here) and update .env.example accordingly.
  8. Create an updater in main.py like _forum_updater and add that to the logic in DiscordBot, send_telegram_messages and run_reddit_bot.

It might seem like there are a lot of steps, but each step is really only a few lines of code and I've tried to map out all the steps exhaustively. Do let me know if you have any questions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants