Giter Club home page Giter Club logo

coucou_suisse's Introduction

Coucou Suisse

This is the source code for a Mastodon "Coucou Suisse". It's designed to ring each hour, like a Cuckoo Clock.

This tool is distributed under the terms of the WTFPL. See the LICENSE.txt file for more details.

Requirements

  • A Mastodon account,
  • an active application linked to this account with the write:statuses permission,
  • crontab (or a scheduler with the equivalent feature),
  • curl

Once you've put the coucou.sh script in a dedicated location, you'll have to make sure that it's executable.

You'll then need to set at least 3 env variables:

  • TZ: to set to the timezone you want (for example: "Europe/Zurich"),
  • MASTODON_HOST: the instance your bot has been registered,
  • ACCESS_TOKEN: the value of the access token of your app.

File example

export MASTODON_HOST=botsin.space
export ACCESS_TOKEN='lookatmybeautifulsecrettokenvalue'
export TZ=Europe/Zurich

(There's an example in this repository, adapt it to your needs)

I'd recommend to save those values in an environment file, and make sure that your ACCESS_TOKEN is kept secret.

crontab setup

Using the crontab -e command, you'll access to your current accont Cron tab. In order to make sure to ring on the round hour, your cron line should look like this:

0   *  *   *   *     BASH_ENV=/path/to/coucou_suisse/env.sh /path/to/coucou_suisse/coucou.sh

This means that the bot script will be executed every day, at each round hour.

coucou_suisse's People

Contributors

brunobord avatar

Stargazers

Joachim avatar

Watchers

 avatar  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.