fme-twitter
v1.3.2
Published
Twitter module for aggregating twitter data
Downloads
70
Maintainers
Readme
README
fme-twitter
What is this repository for?
This extends the npm twit module.
Tweets authors/users are stored in a mongo database. Users can be favorited and added to the follow list or blocked.
The main FmeTwitter object is instatiated with a mongo database and the keys object which corropsond to the format needed for NPM Twit.
Once institaed you can start a stream after you load up IDS and Filter words you want the stream to filter on.
fmeTwitter.adaptiveFilter <string []> is a string array of words you want watch on the twitter stream.. ie. $ibm if you want to follow IBM stock for instance.
fmeTwitter.users.addImportant(id:number) is is the twitter ID of the user and will add the user to the importnat list for inclusion the following ids.
fmeTwitter.user.addBlock(id:number) will add the user to the blocked user list.
The users are stored in a mongo collection twitter_users and is read when the fme-twitter object is constructed.
To start a stream use
fmeTwitter.startStream()
to get twitter data:
*fmeTwitter.stream.on("message" (message:tweet) => {do something with the message}); *
if your twitter app keys are setup to allow writing you can write via the twitter account fmeTwitter.send(message:string)
How do I get set up?
npm install fme-twitter
Useage
var twitClient = new FmeTwitter(db,keys);
###where: db:mongo.Db; ####Open mongo database keys:{} ; #### Twitter application keys in following format:
{
"consumer_key": "Some String",
"consumer_secret": "Some String",
"access_token": "Some String",
"access_token_secret": "Some String"
}
Contribution guidelines
Who do I talk to?
Marlin_@_fortunesrocks_period_me