GithubHelp home page GithubHelp logo

honzajavorek / film2trello Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.85 MB

Turns film links to Trello cards ๐Ÿฟ

Home Page: https://github.com/honzajavorek/film2trello

License: MIT License

Python 2.78% HTML 97.21% Dockerfile 0.02%
trello films movies csfd personal-tool

film2trello's Introduction

film2trello

Personal Telegram bot which turns CSFD.cz and KVIFF.TV film links to Trello cards ๐Ÿฟ Allows me and my wife to use Trello as our "To Watch" list for films. Assumed Trello board structure:

  • First column is an inbox, a "To Watch" list.
  • Any number of "Seen" columns follows, e.g. "Seen in 2024", "Seen in 2023"โ€ฆ
  • Last column is "Archive". If a card is in the inbox for several years, it gets moved out of the way to this archive.

Setup

  • Install by Poetry
  • Set TELEGRAM_TOKEN environment variable to the token BotFather gives you
  • Set TRELLO_KEY environment variable to something you get at Trello Power-Ups Admin
  • Set TRELLO_TOKEN environment variable to something you get at Trello Power-Ups Admin, alternatively make a GET request to https://trello.com/1/authorize?expiration=never&scope=read,write&response_type=token&name=film2trello&key=<TRELLO_KEY>, where TRELLO_KEY is the key above.
  • Verify which Trello board you want to use, because the default value for the board ID is set to ours. Override it with --board. Get the ID of your board from its URL, e.g. if the URL of the board is https://trello.com/b/mF7A3n3J/filmy-test, then mF7A3n3J is the ID.
  • Verify which Telegram users you want to allow and how they map to your Trello users, because the default values are set to us. Override it with --user, e.g. --user=119318534:honzajavorek. You can use the option multiple times to allow more users. I don't remember how I've got the Telegram account IDs, ask the internet.
  • Run film2trello bot
  • Stop by Ctrl+C

Development

  • Use Poetry to manage dependencies.
  • Run pytest to test.
  • Run ruff check to lint.
  • Run ruff format to format code.
  • To temporarily turn off production, run flyctl machine stop. To bring it back, run flyctl machine start.

Deployment

The app runs on Fly.io. Install their flyctl. Then you can do things like flyctl launch --name=film2trello or flyctl deploy. Use the following to prepare the environment:

$ flyctl secrets set TRELLO_KEY=... TRELLO_TOKEN=... TELEGRAM_TOKEN=...

The app also uses GitHub Actions. It needs the TRELLO_KEY, and TRELLO_TOKEN secrets set on the secrets setting page. The rest is in the .github directory.

Automatic Deployment

Set GitHub Actions secret FLY_API_TOKEN to a value you get by running flyctl auth token.

License

MIT

film2trello's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar honzajavorek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

film2trello's Issues

TV Shows point to the parent URL and not to SE01, SE02, etc.

2024-01-21 23:45:25,123 - film2trello.core - INFO - CSFD.cz URL: https://www.csfd.cz/film/697624-love-death-robots/prehled/
2024-01-21 23:45:26,130 - film2trello.core - INFO - Different target URL, scraping: https://www.csfd.cz/film/697624-love-death-robots/prehled/
2024-01-21 23:45:27,350 - film2trello.core - INFO - Different parent URL, scraping: https://www.csfd.cz/film/697624-love-death-robots/prehled/
...
2024-01-21 23:45:29,324 - film2trello.core - INFO - CSFD.cz URL: https://www.csfd.cz/film/1184280-medved/prehled/
2024-01-21 23:45:29,783 - film2trello.core - INFO - Different target URL, scraping: https://www.csfd.cz/film/1184280-medved/prehled/
2024-01-21 23:45:30,402 - film2trello.core - INFO - Different parent URL, scraping: https://www.csfd.cz/film/1184280-medved/prehled/

URL validation in the bookmarklet

The bookmarklet should validate the URL and reject to do anything in case the URL doesn't look like a valid one. That would be nice to have to avoid the often happening situation when I mistakenly click the bookmarklet button on a different site.

Sometimes submitting a film crashes with HTTP 400

Looks like it happens when f2t needs to create a new label? O_o

400 Client Error: Bad Request for url:
https://trello.com/1/cards/5da2df514260c55dfaab182a/labels?token=<TRELLO_TOKEN>&key=<TRELLO_KEY>&name=1.5h&color=yellow

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.