Node Twitter contributor daemon
This is a Node.js daemon to allow multiple users to post link to one Twitter account and Tumblr blog. It also tracks favs and provides feedback to contributors when their links get engagement.
While @GIFs is currently running on a Raspberry Pi, you may run this in any Node environment.
Installation & Setup
Install and configure Node and NPM
Create Twitter API keys and Tumblr API keys and add them to config.json
Additional Configuration
Configs found in daemon.js:
environment = "prod", // 'dev' for development or 'prod' for production
config_file = require("./config.json"), // See config-sample.json
show_heartbeat = false, // false logs heartbeat message to stdout only, true logs to logfile as well
tweet_rate = 20, // Minutes between Tweetsconfig.json
{
"prod": {
"twitter": {
"screen_name": "<main username>",
"user_id": "<id of the account to control>",
"admin_id": "<id of the account that will receive errors and notices>",
"consumer_key": "xxx",
"consumer_secret": "xxx",
"oauth_token": "xxx",
"oauth_secret": "xxx"
},
"tumblr": {
"blog_name": "blog",
"blog_url": "blog.tumblr.com",
"consumer_key": "xxx",
"consumer_secret": "xxx",
"oauth_token": "xxx",
"oauth_secret": "xxx"
}
},
"dev": {
"twitter": {
"screen_name": "<dev username>",
"user_id": "<id of the account to control during development>",
"admin_id": "<id of the account that will receive errors and notices during development>",
"consumer_key": "xxx",
"consumer_secret": "xxx",
"oauth_token": "xxx",
"oauth_secret": "xxx"
},
"tumblr": {
"blog_name": "blog-test",
"blog_url": "blog-test.tumblr.com",
"consumer_key": "xxx",
"consumer_secret": "xxx",
"oauth_token": "xxx",
"oauth_secret": "xxx"
}
}
}Third party package documentation
- dblite - SQLite database integration
- twitter - Twitter REST & Streaming API
- user-stream - Twitter Streaming API (More complete Streaming support than above)
- tumblrwks - Tumblr REST API
- request - Various HTTP handlers
TODO:
- Track retweet counts
- Periodically backfill fav counts to make sure local counts match Twitter's counts
- Create contributor leaderboard