Giter Site home page Giter Site logo

whoamiafterall / bewegungskalender2telegram Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 15.67 MB

A Script that automatically fetches events from a nextcloud caldav server and sends them to Telegram via a Bot.

Home Page: https://klimax.online/bewegungskalender

License: Apache License 2.0

Shell 1.97% Python 43.18% HTML 26.34% Dockerfile 0.14% JavaScript 28.37%
caldav python bewegungskalender activism icalendar nextcloud calendar kalender

bewegungskalender2telegram's Introduction

Bewegungskalender2Telegram

This has been a fork of https://gitlab.com/iexos/caldav2telegram but can be seen as a standalone project by now.

Features

This script does several things (most of them optional) interacting with Nextcloud Calendars via caldav:

  • Get Events submitted through a Form and automatically add them to a calendar
  • Fetch all the Events from multiple Calendars in a given timeframe.
  • Locate those Events on Openstreetmap using Nominatim, producing GeoJSON files for a Map
  • Write a Message listing the Events in MarkDown, HTML, or Plain Text.
  • Send the message to a Mailing List in HTML: [email protected]
  • Post the message to a Telegram channel in MarkDown: https://t.me/bewegungskalender
  • Write the Message to StdOut in Plain Text

Roadmap

  • Add the Option to edit Telegram messages (in Progress)
  • Add the Option to send the message to Mastodon
  • Refactor to use more Object Oriented Programming
  • Rewrite the Argparser to act like a cli-program with subcommands

See TODO.md for more information.

Setup

This is a Work in Progress, it should be installable via pip in the future.

Setup in Virtual Environment#

  1. python3 -m venv <directory>
  2. source <directory>/bin/activate
  3. cd <directory>
  4. git clone https://github.com/whoamiafterall/bewegungskalender2telegram.git
  5. pip install --upgrade pip
  6. pip install -r requirements.txt

You need to create a config file. You can specify the path using --config CONFIG_PATH or use the default config.yml. Just copy config.example.yml and change it to your needs.

Setup Telegram

For the telegram output, you will need to setup a telegram bot:

  • get a token first, see the Telegram documentation
  • insert the token into your config file
  • invite the bot into a channel or group
  • run with --get-telegram-updates flag to get the id of that channel/group
  • you may get the update for being added to a channel only once! If you miss it, remove the bot from that channel and add it again
  • insert the correct channel_id into your config file

Running

Run the script via

cd bewegungskalender
python3 -m bewegungskalender.main

Use -h flag for more information

To make it post regular updates with Events, schedule it via cron or similar.

Dev testing

This is a work in progress. You will need pytest and podman-compose to run tests.

bewegungskalender2telegram's People

Contributors

whoamiafterall avatar

Stargazers

Tim avatar

Watchers

 avatar

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.