项目作者: groenstroem

项目描述 :
Twitter bot posting automatic updates on the Danish emission intensities.
高级语言: Python
项目地址: git://github.com/groenstroem/twitter.git
创建时间: 2020-04-02T13:16:48Z
项目社区:https://github.com/groenstroem/twitter

开源协议:

下载


Grøn strøm Twitter bot

This repository contains the code for the Twitter bot posting automatic updates
on the Danish emission intensities, currently live as @co2prognoser.

Configuration

To use this, get a consumer key and consumer secret from https://dev.twitter.com/. With that,
allow the app to post as a given user by authenticating with the app as that user; the simplest way
to do this is using twitter.oauth_dance, cf. the documentation.

Running

With these at hand, fill out config.json.example and move the result to config.json.

Then, to create a Twitter update with the current emission intensities, get all dependencies and run the only
available script,

  1. pip install requests twitter
  2. python tweet.py

Docker

Alternatively, use Docker, specifying all configuration parameters as environment variables,

  1. docker build -t groenstroem-twitter .
  2. docker run -e OAUTH_TOKEN=... -e OAUTH_SECRET=... -e CONSUMER_KEY=... -e CONSUMER_SECRET=... groenstroem-twitter