1.0.3 • Published 7 years ago
the-crawler-twitter v1.0.3
the-crawler-twitter
Crawler for twitter
Installation
$ npm install the-crawler-twitter --save
Usage
'use strict'
const theDB = require('the-db')
const { TheTwitterCrwl } = require('the-crawler-twitter')
async function tryExample () {
const db = theDB({ /* ... */ })
{
class TweetResource extends theDB.Resource { /* ... */ }
class TweetHtml extends theDB.Resource { /* ... */ }
db.load(TweetResource, 'Tweet')
db.load(TweetHtml, 'TweetHtml')
}
{
let crwl = new TheTwitterCrwl({
resources: {
consumerKey: 'xxxxxxxxxxxxxxxxxxx',
consumerSecret: 'xxxxxxxxxxxxxxxxxxx',
accessTokenKey: 'xxxxxxxxxxxxxxxxxxx',
accessTokenSecret: 'xxxxxxxxxxxxxxxxxxx',
Resource: db.resources.Tweet,
HtmlResource: db.resources.TweetHtml
}
})
await crwl.run({})
}
}
tryExample().catch((err) => console.error(err))
API Guide
License
This software is released under the MIT License.