[GAE/Python] Tumblr periodic reblog bot. Reblogging from past posts at random and add to queue if the queue has decreased. My tumblr blog(https://oninoheizo.tumblr.com) is managed by this program.
$ cd /your/project
$ pip install -t lib flask pytumblr python-dateutil pytz requests-toolbelt
$ cp secret.yaml.sample secret.yaml
secret.yaml
env_variables:
BLOG_NAME: "YOUR BLOG NAME"
CONSUMER_KEY: "YOUR CONSUMER KEY"
CONSUMER_SECRET: "YOUR CONSUMER SECRET"
OAUTH_TOKEN: "YOUR OAUTH TOKEN"
OAUTH_SECRET: "YOUR OAUTH SECRET"
Add your blog name, consumer_key, consumer_secret, oauth_token and oauth_secret.
https://www.tumblr.com/oauth/apps
- Create a project.
- Enable automatically publish a queued post.
(e.g. 5 times a day between 12 am and 12 am)
- MIN_QUEUE: Run reblog task if the number of queues is less than MIN_QUEUE.
- ADD_QUEUE: Number of posts in a single reblog task.
- DAYS_BEFORE: Reblog posts are older than DAYS_BEFORE days from now.
- MIN_NOTE: Reblog posts have more than MIN_NOTE notes.
cron:
- description: "queue check"
url: /deffer
schedule: every 3 hours
(e.g. check the queue every 3 hours.)
$ gcloud app deploy
$ gcloud app deploy cron.yaml
$ gcloud app deploy queue.yaml
Need a lot of past posts.