Skip to content

Node app with Express framework able to catch tweets based on hashtags, store them into a PostgreSQL database and sent callback to client using Socket.io.

Notifications You must be signed in to change notification settings

SpotMyFlat/SMF-Twitter-Streaming-Full-Stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMF-Twitter-Streaming-Full-Stack

Node app with Express framework able to catch tweets based on hashtags, store them into a PostgreSQL database and sent callback to client using Socket.io.

Installation

  • Clone the repository
$ git clone [email protected]:SpotMyFlat/SMF-Twitter-Streaming-Full-Stack.git
  • Install dependencies using npm
$ npm install
  • Use Grunt to watch files and run the app
$ grunt

Configuration

Log in the Twitter Dev Portal and create a new application - required to use the Twitter API. Set your credentiels in app.js file :

var T = new Twit({
    consumer_key:           'YourConsumerKey'
    , consumer_secret:      'YourConsumerSecret'
    , access_token:         'YourAccessToken'
    , access_token_secret:  'YourAccessTokenSecret'
});

Inject the table which structure is described in database/dump.sql in your own database, and set up your database name in app.js :

var conString = 'postgres://postgres:root@localhost/YourDatabaseName';

You can also set your own pattern to match in the same file:

var stream = T.stream('statuses/filter', { track: '#twitter' });

Finally run $ grunt and open client/client.html in your favorite browser with Debugger Tools. You'll see tweets appear as soon as they are posted. Check your table, it should be filled with tweet.

Credits

Twitter Streaming API of course, but also the awesome Twit library combined with the more-than-useful Pg helper library.

Contribute

Use the develop branch and request a merge on master using a pull-request, describing the task accomplished in your commit(s).

If you find a bug or a missing feature, please submit an issue.

About

Node app with Express framework able to catch tweets based on hashtags, store them into a PostgreSQL database and sent callback to client using Socket.io.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published