Giter VIP home page Giter VIP logo

weeklyosmnotifier's Introduction

weeklyOSM Notification Tool

This is the OSM Weekly Notification Tool for sending updates in different languages. It supports posting to a forum, sending emails and toots and tweets. Feel free to use it as a baseline for simmilar usecases.

Disclaimer: This software is unlicensed! For more information, please refer to http://unlicense.org

installation

Clone this repo with submodules: git clone --recurse-submodules [email protected]:call-me-matt/weeklyOSMnotifier.git

On linux run setup.sh to get you started with all requirements for a python environment.

First you should insert your secrets into the file configs/private/secrets/weeklysecrets.yaml. You would need to create that file looking something like this:

runnable: False
mail_user: "somegmailusername"
mail_pw: "somegmailssecretpasswort"
forum_KEY: "abcdef123456"
mastondon_INSTANCE: "yourinstance.social"
mastodon_TOKEN: "yourMastodonDeveloperApplicationAccessToken"
tw_CONSUMER_KEY: "yourTwitterConsumerKey"
tw_CONSUMER_SECRET: "yourTwitterConsumerSecretFrdsfor09512kljda98324iu21as"
tw_ACCESS_KEY: "123456-YourTWAccessKeyNelsonMandela4Evaaaa"
tw_ACCESS_SECRET: "YourTWAccessSecretlsdkhjkahdkjahsrwqkjhqwkjhewqkjewqh"
telegram_TOKEN: "YourTelegramBotToken123:456"
josm_user: "yourJosmWikiUser"
jsom_pw: "yourJosmWikiPass"

Next you should define the recipients for each language in a weekly_*.yaml as defined in your configs/configs.yaml

mail_to: 
 - "[email protected]"
 - "[email protected]"
 - "[email protected]"
 - "[email protected]"
 - "[email protected]"

 forum_to: "123456" # posts into https://community.openstreetmap.org/t/some-title/123456/
                    # only one thread possible per language due to forum's antispam

 telegram_to: # send telegram messages to the following recipients (if group, bot must be admin)
  - -123456789 # groups have negative identifiers
  - -987654321
 
 mastodon_to:  # send mastodon direct toots to the following recipients
  - "@user@instance"
  - "@other@instance"

Adding a new language xx

  1. in your configs.yaml add two lines for the xx language
- weekly_xx.yaml:
  - private/mailto/weekly_xx.yaml
  1. create weekly_xx.yaml in the configs-folder. content: text bodies of notifications in xx
  2. in your configs/private/mailto-folder, create weekly_xx.yaml. content: notification recipients for xx

If you copy from another language, don't forget to change the language_header

Utilization

For calling this from a script within the prepared environment call the shellscript runenvweekly2all.sh. It takes the same parameters as the python script but fixes PYTHONIOENCODING to UTF-8 and LC_CTYPE to C.UFT-8 avoiding issues when called from node or other environments.

test call - for twitter

./runenvweekly2all.sh --twitter --pic ~/downloads/C3wrVxcWcAEhtrU.jpg --showpic  "WEEKLYTWTEST" "en,de,fr"

how to call - mail, forum, josm, telegram, mastodon and twitter

./runenvweekly2all.sh --mail --forum --josm --telegram --mastodon --twitter --pic auto --showpic  "WEEKLY" "int,en,ja,ko,zh,id,cn,ru,tr,uk,pl,it,pt,es,fr,de"

weeklyosmnotifier's People

Contributors

call-me-matt avatar blackcoffeerider avatar strubbl 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.