Skip to content

pinceladasdaweb/NodeTwitter

Repository files navigation

NodeTwitter

Display your latest tweets with Node.js and VanillaJS

Demo

Access the url and view in action.

How to use?

NodeTwitter is a Vanilla JS plugin with no dependancies. It is a very simple example of how to get your latest updates on Twitter with Node.js and show the customer with pure JavaScript.

1 - Open the file views/index.ejs, at the end of the same look for the code block below and fill in your details:

(function(window, document, undefined) {
    NodeTwitter.init({
        username: 'pinceladasdaweb',
        container: '#stream',
        counter: 12
    });
}(window, document));

You can also load the script via AMD:

require(["/path/to/app.min"], function(NodeTwitter) {
    NodeTwitter.init({
        username: 'pinceladasdaweb',
        container: '#stream',
        counter: 12
    });
});

2 - In the config.js file, complete the Twitter OAuth settings:

module.exports = {
    twitter: {
        consumer_key: '',
        consumer_secret: '',
        access_token: '',
        access_token_secret: ''
    }
};

Browser support

IE Chrome Firefox Opera Safari
IE 8+ ✔ Latest ✔ Latest ✔ Latest ✔ Latest ✔

License

NodeTwitter is licensed under the MIT License.