Skip to content

Mallox51/Tuiter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tuiter

Tuiter is a Node.JS library that makes the interaction with the Twitter API easy.

How to install

npm install tuiter

How to use

Require Tuiter

var Tuiter = require('tuiter');

Create a Tuiter object with your Twitter application keys

var tu = new Tuiter({
    "consumer_key" : "blablabla"
  , "consumer_secret" : "blablabla" 
  , "access_token_key" : "blablabla"
  , "access_token_secret" : "blablabla"
});

Use the api methods as you want, for example:

tu.mentions({trim_user: false}, function(err, data){
  console.log(data);	
});

Using the Streaming is a little different:

tu.filter({track: ['soccer','pokemon']}, function(stream){

  // tweets :)
  stream.on('tweet', function(data){
    console.log(data);
  });

  // deleted statuses data
  stream.on('delete', function(del){
    console.log(del);
  });

  // errors
  stream.on('error', function(err){
    console.log(err);
  });
});

Demo

A Tuiter + Express + Socket.io + Google Maps example demo is deployed here. You can find the code here.

Features

  • All API methods available
  • Params preprocessing: Locations as {lat: num,long:num } arrays, allow array params
  • API HTTP Error handling
  • Paging for REST API
  • Custom results for Search API

Available methods

All Search API, REST API and Streaming API methods are available. The names of the methods in the library are up-to-date inside the code

License

(The MIT License)

Copyright (c) 2012 Dan Zajdband <dan.zajdband@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Twitter API lib for nodejs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published