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.
- It may work as intended
- Random titles come from the real wikiHow sitemap (50k+ articles, refreshed daily), keyword search uses the wikiHow
opensearchAPI with a fallback on the cached sitemap, and images are fetched through the still workingparseAPI endpoint — the bot survives the wikiHow anti-scraping walls that killed the oldwhapiapproach - Errors are reported to the chat instead of dying silently
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.
-
Install Docker.
-
Clone this repository:
git clone https://github.com/luke-gto/tutorial-sp-bot
-
Create a telegram bot with Bot Father and copy the API TOKEN
-
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-botThe 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.exampletosrc/.env, paste the token, and uncomment the.envcopy line in theDockerfile.If you prefer running from source:
pip install -r src/requirements.txt, put the token insrc/.envor the environment, thenpython main.py(Python 3.9+). -
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.
main.py— the bot and its handlerssrc/wh_img.py— titles, images and the collage renderertests/test_main.py— offline test suite (python tests/test_main.py), stubs every network call
MIT, see LICENSE.