Skip to content

About

Tutorial shitposting Telegram bot

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

Tutorial shitposting Telegram bot

The most boring, buggy and useless bot ever created

This is a telegram bot that makes random and pointless tutorials. You can use a keyword to generate the title or you can feed the bot with your beautiful title. If you don't feel inspired, the bot can pick a random title. In the examples folder you can find some... examples.

Features

  • It may work as intended
  • Random titles come from the real wikiHow sitemap (50k+ articles, refreshed daily), keyword search uses the wikiHow opensearch API with a fallback on the cached sitemap, and images are fetched through the still working parse API endpoint — the bot survives the wikiHow anti-scraping walls that killed the old whapi approach
  • Errors are reported to the chat instead of dying silently

Installation

You could install this using a Python virtual environment but you could encounter a couple of issues. For a smooth installation I'd suggest you to use Docker. A couple of steps below are specific for Linux-based distros but if you use MacOS or Windows and you know how to use a Dockerfile, you'll do this in 5 minutes.

  1. Install Docker.

  2. Clone this repository:

    git clone https://github.com/luke-gto/tutorial-sp-bot
  3. Create a telegram bot with Bot Father and copy the API TOKEN

  4. Run the bot passing the token as an environment variable:

    docker build -t telegram-shitposting-bot .
    docker run -d -e API_TOKEN='123456789:AAyour-token-here' tutorial-sp-bot
    

    The token is read at runtime, so changing it only means re-running the container — no image rebuild needed. If you really want the old way, copy src/.env.example to src/.env, paste the token, and uncomment the .env copy line in the Dockerfile.

    If you prefer running from source: pip install -r src/requirements.txt, put the token in src/.env or the environment, then python main.py (Python 3.9+).

  5. Now open the chat with the bot you created at step 3, tap on "Start" and enjoy(?).

P.S.: an internet connection is required: the bot talks to wikiHow (sitemap, opensearch and parse endpoints) and to Telegram.


The bot could be a bit buggy, feel free to open an issue if needed.

Development

  • main.py — the bot and its handlers
  • src/wh_img.py — titles, images and the collage renderer
  • tests/test_main.py — offline test suite (python tests/test_main.py), stubs every network call

License

MIT, see LICENSE.

About

Tutorial shitposting Telegram bot

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages