basicset-chronicler
v3.1.0
Published
A module that creates a persistent topic-centric record of an app's interactions with Twitter users.
Downloads
10
Readme
chronicler
A module that creates a persistent topic-centric record of an app's interactions with Twitter users.
Etc.!
Installation
npm install basicset-chronicler
Usage
Create an instance:
var Chronicler = require('basicset-chronicler');
var chronicler = Chronicler({
db: 'appname.db'
});
Warning/TODO: createChronicler should actually be async, but is not. It's not safe to use it until the next tick.
Record that a tweet was replied to.
chronicler.recordThatTweetWasRepliedTo(tweetId, logError);
function logError(error) {
if (error) {
console.log(error);
}
}
Find out if a tweet was replied to.
chronicler.tweetWasRepliedTo(tweetId, function done(error, replied) {
if (replied) {
console.log('Tweet', tweetId, 'was replied to.');
}
});
Find out if a topic has been discussed with a Twitter user.
chronicler.topicWasUsedInTribute('jerks', 'someuserid', reportUsed);
function reportUsed(error, wasUsed) {
if (wasUsed) {
console.log('jerks were discussed with user someuserid.');
}
}
Find out how many times a topic has been discussed with a Twitter user.
chronicler.timesTopicWasUsedInTribute('jerks', 'someuserid', reportUsed);
function reportUsed(error, count) {
console.log('jerks were discussed with user someuserid', count, 'times.');
}
Tests
Run tests with make test
.
License
MIT.