{"_id":"twitter-ng","_rev":"9-cdc27a7dbda51dc5385f2c7bc020ed83","name":"twitter-ng","description":"Asynchronous Twitter REST/stream/search client API for node.js.","dist-tags":{"latest":"0.6.2"},"versions":{"0.3.1":{"name":"twitter-ng","version":"0.3.1","description":"Asynchronous Twitter REST/stream/search client API for node.js.","keywords":["twitter","streaming","oauth"],"homepage":"https://github.com/Isolus/twitter-ng","author":{"name":"jdub, changes by AvianFlu, Isolus"},"licenses":{"type":"MIT","url":"http://github.com/Isolus/twitter-ng/raw/master/LICENSE"},"repository":{"type":"git","url":"http://github.com/Isolus/twitter-ng.git"},"dependencies":{"oauth":">=0.8.4"},"devDependencies":{"should":"*","mocha":"*"},"engines":{"node":">=0.4.0"},"main":"./lib/twitter","bugs":{"url":"https://github.com/Isolus/twitter-ng/issues"},"_id":"twitter-ng@0.3.1","dist":{"shasum":"0a822523434302b8fb4710a65bd9518dfaa528d4","tarball":"https://registry.npmjs.org/twitter-ng/-/twitter-ng-0.3.1.tgz","integrity":"sha512-EcJO/QPd521B4wyamga+gEYjET4guSeujiTep+rp+5Q8EurRyxkD2k6sFx6Vw0nM8QNoz68y/8Dz5ZvEpZnfeg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHc1cJ4cHwonB5eRgudgNcS4dm6VGKjbb+rpTkM5oPZyAiEAhMEsULLkr3O6Z3nOZvBmyZupnWaLbHb3zU035CLb0wU="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"isolus","email":"isolus.dev@gmail.com"},"maintainers":[{"name":"isolus","email":"isolus.dev@gmail.com"}],"directories":{}},"0.6.0":{"name":"twitter-ng","version":"0.6.0","description":"Asynchronous Twitter REST/stream/search client API for node.js.","keywords":["twitter","streaming","oauth"],"homepage":"https://github.com/Isolus/twitter-ng","author":{"name":"jdub, changes by AvianFlu, Isolus"},"licenses":{"type":"MIT","url":"http://github.com/Isolus/twitter-ng/raw/master/LICENSE"},"repository":{"type":"git","url":"http://github.com/Isolus/twitter-ng.git"},"dependencies":{"oauth":">=0.8.4"},"devDependencies":{"should":"*","mocha":"*"},"engines":{"node":">=0.4.0"},"main":"./lib/twitter","bugs":{"url":"https://github.com/Isolus/twitter-ng/issues"},"_id":"twitter-ng@0.6.0","dist":{"shasum":"c5b63e6333adb1c8ef408ab2c61b34a6ff6f2524","tarball":"https://registry.npmjs.org/twitter-ng/-/twitter-ng-0.6.0.tgz","integrity":"sha512-KLmN9YoH+n9SAbbdyncDRp5/y+gfw/7gw9DqOLgWoOukScNMU5yZc+K/wt84uK0P0/jej+F+Zz+1qU39VJDy1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUKSN1ZOLucf04Ww+8Ae32O/WG3oPqK8RTuTO7vEvbqAiEAmNsdLGdtr92k69yRrPFxUMDVgo2dF1D7XO8eAT85140="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"isolus","email":"isolus.dev@gmail.com"},"maintainers":[{"name":"isolus","email":"isolus.dev@gmail.com"}],"directories":{}},"0.6.1":{"name":"twitter-ng","version":"0.6.1","description":"Asynchronous Twitter REST/stream/search client API for node.js.","keywords":["twitter","streaming","oauth"],"homepage":"https://github.com/Isolus/twitter-ng","author":{"name":"jdub, changes by AvianFlu, Isolus"},"licenses":{"type":"MIT","url":"http://github.com/Isolus/twitter-ng/raw/master/LICENSE"},"repository":{"type":"git","url":"http://github.com/Isolus/twitter-ng.git"},"dependencies":{"oauth":">=0.9.9"},"devDependencies":{"should":"*","mocha":"*"},"engines":{"node":">=0.4.0"},"main":"./lib/twitter","bugs":{"url":"https://github.com/Isolus/twitter-ng/issues"},"_id":"twitter-ng@0.6.1","dist":{"shasum":"31967f5de1708524d03099eab27a11506dfeacd4","tarball":"https://registry.npmjs.org/twitter-ng/-/twitter-ng-0.6.1.tgz","integrity":"sha512-AEsaX89RQ1DSGyK8xCJyyxLIgwVztV0pyh3wVVnKk0PvJcDRSeE9CeQgVwcWkEhQbkNuoHuR4A+B0svbhgs3pw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBpu4EEbUaF2GvyKW0f0zi9zpsTjc/+iwz9XEE3bId4rAiEA9n+KED8vnGr0ONDEpgUOpJn59N6Qd1rYwMnkrWpoNSQ="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"isolus","email":"isolus.dev@gmail.com"},"maintainers":[{"name":"isolus","email":"isolus.dev@gmail.com"}],"directories":{}},"0.6.2":{"name":"twitter-ng","version":"0.6.2","description":"Asynchronous Twitter REST/stream/search client API for node.js.","keywords":["twitter","streaming","oauth"],"homepage":"https://github.com/Isolus/twitter-ng","author":{"name":"Isolus"},"licenses":{"type":"MIT","url":"http://github.com/Isolus/twitter-ng/raw/master/LICENSE"},"repository":{"type":"git","url":"http://github.com/Isolus/twitter-ng.git"},"dependencies":{"oauth":">=0.9.9"},"devDependencies":{"should":"*","mocha":"*"},"engines":{"node":">=0.4.0"},"main":"./lib/twitter","bugs":{"url":"https://github.com/Isolus/twitter-ng/issues"},"_id":"twitter-ng@0.6.2","dist":{"shasum":"13707115dd04c9bd1f2c646da976589be4d64bc4","tarball":"https://registry.npmjs.org/twitter-ng/-/twitter-ng-0.6.2.tgz","integrity":"sha512-XPyqy8vYEpJUOy4/Pt6x5jDN0aOxmI2oIebQU7Ys22AosauRsuEU5Ly1dkSBWHsGjJe88tv1YOy+PtH4WymoyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFbnmOCwtL4LOK07veK8Hmw/j+bWauNiHMRb7qC5o+3AiAIG/TyrtSb/qQKECPMln1krE91J+idsdQnA95h+U7x0Q=="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"isolus","email":"isolus.dev@gmail.com"},"maintainers":[{"name":"isolus","email":"isolus.dev@gmail.com"}],"directories":{}}},"readme":"Asynchronous Twitter client API for node.js\n===========================================\n\n[twitter-ng](http://github.com/Isolus/twitter-ng) is an improved version of AvianFlu's [ntwitter](http://github.com/AvianFlu/ntwitter) which is based on jdub's [node-twitter](http://github.com/jdub/node-twitter), which in turn was inspired by, and uses some code from, technoweenie's [twitter-node](http://github.com/technoweenie/twitter-node).\n\n\n## Installation\n\nYou can install twitter-ng and its dependencies with npm: `npm install twitter-ng`.\n\n\n### Setup API \n\nThe keys listed below can be obtained from [dev.twitter.com](http://dev.twitter.com) after [setting up a new App](https://dev.twitter.com/apps/new).\n\n``` javascript\nvar twitter = require('twitter-ng');\n\nvar twit = new twitter({\n  consumer_key: 'Twitter',\n  consumer_secret: 'API',\n  access_token_key: 'keys',\n  access_token_secret: 'go here'\n});\n```\n\n\n### Obtaining Access Token\n\nThis example assumes that you use [express](http://expressjs.com/).\n\n``` javascript\napp.get('/twitter_signin', restrict, function(req, res, next) {\n  var twit = new twitter({\n    consumer_key: 'KEY',\n    consumer_secret: 'SECRET',\n    oauth_callback: 'https://example.org/twitter_callback'\n  });\n  twit.login()(req, res, next);\n\n});\napp.get('/twitter_callback', restrict, function(req, res){\n  var twit = new twitter({\n    consumer_key: 'KEY',\n    consumer_secret: 'SECRET',\n  });\n  twit.callback()(req, res, function() {\n    console.log(\"Access Token: \" + req.session.oauth_access_token);\n    console.log(\"Access Token Secret: \" + req.session.oauth_access_token_secret);\n  });\n});\n```\n\n### REST API \n\nInteraction with other parts of Twitter is accomplished through their RESTful API.\nThe best documentation for this exists at [dev.twitter.com](http://dev.twitter.com).  Convenience methods exist\nfor many of the available methods, but some may be more up-to-date than others.\nIf your Twitter interaction is very important, double-check the parameters in the code with \nTwitter's current documentation.\n\nNote that all functions may be chained:\n\n``` javascript\ntwit\n  .verifyCredentials(function (err, data) {\n    console.log(data);\n  })\n  .updateStatus('Test tweet from twitter-ng/' + twitter.VERSION,\n    function (err, data) {\n      console.log(data);\n    }\n  );\n```\n\n### Streaming API \n\nThe stream() callback receives a Stream-like EventEmitter.\n\nHere is an example of how to call the `statuses/sample` method:\n\n``` javascript\ntwit.stream('statuses/sample', function(stream) {\n  stream.on('data', function (data) {\n    console.log(data);\n  });\n});\n```\n        \nHere is an example of how to call the 'statuses/filter' method with a bounding box over San Fransisco and New York City ( see streaming api for more details on [locations](https://dev.twitter.com/docs/streaming-api/methods#locations) ):\n\n``` javascript\ntwit.stream('statuses/filter', {'locations':'-122.75,36.8,-121.75,37.8,-74,40,-73,41'}, function(stream) {\n  stream.on('data', function (data) {\n    console.log(data);\n  });\n});\n```\n\ntwitter-ng also supports user and site streams:\n\n``` javascript\ntwit.stream('user', {track:'nodejs'}, function(stream) {\n  stream.on('data', function (data) {\n    console.log(data);\n  });\n  stream.on('end', function (response) {\n    // Handle a disconnection\n  });\n  stream.on('destroy', function (response) {\n    // Handle a 'silent' disconnection from Twitter, no end/error event fired\n  });\n  // Disconnect stream after five seconds\n  setTimeout(stream.destroy, 5000);\n});\n```\n\n## Contributors\n\n[Lots of people contribute to this project. You should too!](https://github.com/Isolus/twitter-ng/contributors)\n\n## TODO\n\n- Complete the convenience functions, preferably generated\n- Support [recommended reconnection behaviour](https://dev.twitter.com/docs/streaming-apis/connecting#Best_practices) for the streaming APIs\n- Better support for rate limiting.\n\n","maintainers":[{"name":"isolus","email":"isolus.dev@gmail.com"}],"time":{"modified":"2022-06-28T00:18:35.283Z","created":"2014-02-01T13:56:23.884Z","0.3.1":"2014-02-01T13:56:23.884Z","0.6.0":"2014-02-01T16:42:33.300Z","0.6.1":"2014-02-02T15:47:17.859Z","0.6.2":"2014-02-04T21:24:22.461Z"},"readmeFilename":"README.md","users":{"moniqx4":true}}