fionn / floating-city

It takes courage to live without roots

Home Page:https://twitter.com/floatingcitybot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Floating City

The @floatingcitybot appeared suddenly.

About

A Twitter bot that tweets Marvels of a Floating City by Xi Xi.1

We take paragraphs from the source material and greedily split them into groups of sentences, maximising length subject to the character limit. If this is not possible (i.e. we have very long sentences), we split by delimiter instead.

State is maintained by Twitter, so we check what the last tweet was, find it in our array of text groups and tweet the next element. If there is no last tweet, start from the start. If the last tweet is the last text group in our array, we've finished, so do nothing (as opposed to restarting).

Usage

Requires the standard Twitter API environment variables. Generate them with fionn/twitter-authenticator.

Run src/tweetify.py to print each text group.

Run src/main.py to tweet once and exit.

Deploy

Deploy

Add the remote with git remote add heroku https://git.heroku.com/app-name.git and use git push heroku to deploy.

Footnotes

  1. As translated by Linda Jaivin and Geremie Barmé, sourced from China Heritage and reproduced (with minor corrections) in data/floating_city_en.md.

About

It takes courage to live without roots

https://twitter.com/floatingcitybot


Languages

Language:Python 88.2%Language:Makefile 11.2%Language:Procfile 0.6%