sarah-twitter
v0.0.4
Published
This is the Twitter trigger for the Sarah platform.
Downloads
4
Readme
Sarah-Twitter
Features
Users
- New tweet
- New direct message
Search
- New tweet
Sample code
module.exports = (domain) => {
//Create a new Twitter task generator
var twitter = domain.trigger('Twitter');
//Get user with userId '256002682', which is @Breaking_NL
var user = twitter.user(256002682);
//When a new tweet is posted
user.on('tweet', (tweet) => {
console.log(tweet.text);
});
//When a new direct message is send
user.on('direct_message', (dm) => {
console.log(dm);
});
};
Known issues
The twitter trigger uses the twit library which
(currently) can't be used in strict mode due to an error in one file. I already
opened a pull-request for the fix but
this might take a while. Until then, after installing this library please path the
file: node_modules/lib/streaming-api-connection.js
as seen on: https://github.com/ttezel/twit/pull/206/files