1.0.4 • Published 8 years ago

twitter-node-client-factory v1.0.4

Weekly downloads
10
License
ISC
Repository
github
Last release
8 years ago

twitter-node-client-factory

Seamlessly create a twitter-node-client while reading the configuration from the environment.

var twitterClient = require("twitter-node-client-factory")();

twitterClient.getUserTimeline({
    screen_name: 'camilin87',
    count: '10'
}, (err, response, body) {
    console.log('ERROR [%s]', err);
}, (data) {
    console.log('Data [%s]', data);
});

Dependencies

The environment variables TWITTER_CONSUMER_KEY and TWITTER_CONSUMER_SECRET should be set.

Custom Dependencies

Supports different environment variables as long as their names are specified.

var twitterClient = require("twitter-node-client-factory")(
    null, null, null, "KEY", "SECRET"
);

twitterClient.getUserTimeline({
    screen_name: 'camilin87',
    count: '10'
}, (err, response, body) {
    console.log('ERROR [%s]', err);
}, (data) {
    console.log('Data [%s]', data);
});

Authenticated Requests

The created clients can be used to make API calls that require authentication.

var twitterClient = require("twitter-node-client-factory")(
    "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET"
);

twitterClient.postTweet({
    status: 'Hello World!'
}, (err, response, body) {
    console.log('ERROR [%s]', err);
}, (data) {
    console.log('Data [%s]', data);
});
1.0.4

8 years ago

1.0.4-beta.1

8 years ago

1.0.4-beta.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago