Giter VIP home page Giter VIP logo

varieteebot's Introduction

VarieTee Bot

Tee Bot [TEST] Tee Bot [PROD]

If you know me personally, you can see that I love nerd tee-shirts. There are lots of websites that sell tees with several designs. In particular, I prefer tee websites that propose t-shirts having designs made by little designers. It means that any person can create a design and send it to one of these websites. If the project is very voted by the users of online tee shop, the administrators can decide to put on sale for 24 hours. Therefore, Every day a different t-shirt is sold.

Then, I decided to create a tee bot that sends today's tees sold by different tee shops.

How it works

Every day the telegram bot extracts today's tees with web scraping and sends the images and the titles on a public telegram channel.

Implementation

The repository contains mainly three files:

  • tee.py: it contains the function get_tees that returns a list of objects of type Image. Each object contains:
    • tee title
    • URL of the image source
    • URL of the tee shop
  • run.py: it sends the list of tees to the public telegram channel using the Telegram API. This script has two parameters:
    • bot token
    • channel id
  • python-app-test.yml: Github action that on the event push of the branch main installs the pip dependencies and executes the script using the GitHub secrets BOT_TOKEN and CHANNEL_TEST_ID. This action is used for the test.
  • python-app-prod.yml: Github action that on the event schedule (every day at 7 UTC) installs the pip dependencies and executes the script using the GitHub secrets BOT_TOKEN and CHANNEL_ID. This action is used for the main channel.

Configuration

  1. Create the telegram bot using BotFather
  2. Create a public telegram channel
  3. Add the bot as the administrator of the channel
  4. Fork my GitHub repository varieteebot
  5. In the repository settings create 3 secrets:
    • BOT_TOKEN: the token returned by the BotFather and used to call the Telegram Bot API
    • CHANNEL_ID: the public telegram channel id on which the tees are sent (@channelname)
    • CHANNEL_ID_TEST: the channel id for the test (I used my personal chat id)
  6. Test opening the section Actions of the repository and clicking on Tee Bot [TEST] and on Run workflow
  7. Test in your local environment by typing the following command
    python run.py {BOT_TOKEN} {CHANNEL_ID}

My tee's channel

My fantastic channel is VarieTee. If you like it you can follow the channel and give me feedback.

varieteebot's People

Contributors

frascu avatar renovate[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

varieteebot's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/python-app-prod.yml
  • actions/checkout v3
  • actions/setup-python v4
.github/workflows/python-app-test.yml
  • actions/checkout v3
  • actions/setup-python v4
pip_requirements
requirements.txt
  • requests ~=2.31.0
  • bs4 ~=0.0.1
  • beautifulsoup4 ~=4.12.0
  • selenium ~=4.11.2

  • Check this box to trigger a request for Renovate to run again on this repository

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.