hummingbird
Stupidly simple social media streaming for Node.js
Hummingbird is an independent node.js application that makes connecting to/managing real-time social media interactions simple. Real-time updates are processed by hummingbird and then placed into a Redis queue for whatever you want to do with them.
This README is only going to cover the basics for now, as the project is going through a bit of a refactor into new module.
Documentation is ongoing and incomplete, but you can get details in the wiki.
Supported Services
- Twitter
- Facebook
- Instagram
- Wordpress
Using Hummingbird
Hummingbird is manipulated strictly through a REST api, and each interaction must be defined by the service requesting a modification.
Accounts
Accounts for social media can be tracked my making REST calls to the /accounts
endpoint.
Supported by twitter, facebook, instagram
Create
POST /accounts
service=twitter
- (REQUIRED)service_id=123456789
- (REQUIRED) Must be the numerical ID of the twitter accountauth_token=sdfsdfsdf
- (facebook, instagram) Must be obtained by the oauth process of those services.
Destroy
DELETE /accounts
service=twitter
- (REQUIRED)service_id=123456789
- (REQUIRED) Must be the numerical ID of the twitter account
Keywords
Keywords are equivalent to hashtags without the hashtag, just the raw content.
Supported by twitter, facebook, instagram.
Create
POST /keywords
service=twitter
- (REQUIRED)phrase=my keyword
- (REQUIRED) The phrase to track. Be sure to omit the "#" symbol.
Destroy
DELETE /keywords
service=twitter
- (REQUIRED)phrase=my keyword
- (REQUIRED) The phrase to track. Be sure to omit the "#" symbol.
Posts
When a real-time update is received, Hummingbird generates a post and stores it on your Redis queue.
Hummingbird posts normalize the updates into a single, consistent JSON format, regardless of the service it came from. Complete documentation on the structure of a post is available in the wiki.
Example Post
{
service: 'twitter',
service_id: '123456790',
timestamp: '2014-03-19T10:08:00.070Z',
text: 'text @mention #keyword text',
external_uri: 'http://service.com/service_id/status/123456790',
author: {
service: 'twitter',
service_id: '1234567890',
user_name: 'cool_dude23',
display_name: 'Mr. Cool Dude',
description: 'I am a cool dude.',
avatar: 'http://service.com/1234567.jpg'
},
mentions: [
{
service: 'twitter',
service_id: '1234567',
user_name: 'cool_dude23',
display_name: 'Mr. Cool Dude'
}
],
keywords: [
{
phrase: 'chapmanu'
}
],
urls: [
{
domain: 'google.com',
link: 'http://google.com/news',
shortened_link: 'http://g.co/news'
}
],
photos: [
{
image: 'http://service.com/some/cool/image/12345.jpg'
}
],
source: {
service: 'twitter',
name: 'Twitter',
description: 'Social networking and microblogging service utilising instant messaging, SMS or a web interface.',
domain: 'twitter.com',
external_uri: 'https://twitter.com/'
}
}
Deployment
In order to run, hummingbird requires:
To deploy (assuming node.js is installed):
git clone git@github.com:chapmanu/hummingbird.git
- Edit
config.js
and set the necessary API credentials and server information. You can edit environment-specific credentials in the various environment files. Settings in environment config files will override config.js when that environment is specified on run. - Run
node app.js
and then go get yourself a beer!