Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/twitterbot
A quick and easy module to post automatic tweets on your profile using NodeJS
https://github.com/hughsk/twitterbot
Last synced: 12 days ago
JSON representation
A quick and easy module to post automatic tweets on your profile using NodeJS
- Host: GitHub
- URL: https://github.com/hughsk/twitterbot
- Owner: hughsk
- Created: 2011-10-08T13:38:10.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2012-01-27T05:30:58.000Z (almost 13 years ago)
- Last Synced: 2024-10-16T14:21:38.405Z (23 days ago)
- Language: JavaScript
- Homepage:
- Size: 95.7 KB
- Stars: 12
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#TwitterBot for Node.JS
As simple as it can get, Twitterbot is a quick and easy module
to post tweets to your profile using NodeJS. If that's all you need
then hopefully it helps you get up and running!Requires [node-oauth](https://github.com/ciaranj/node-oauth) to run.
##Posting to your Account
To post a tweet to your bot's profile:
var twitterbot = require('./lib/bot.js');
var bot = twitterbot.create({
key:'KEY',
key_secret:'SECRET',
token_key:'USERKEY',
token_secret:'USERSECRET'
});bot.post("Hello World");
Easy, right? You'll have to fill in the authentication details to match your Twitter app and
account of course. You can include `post` as a parameter to post straight away too:require('./lib/bot.js').create({
post: "Hello World",
key: 'KEY', key_secret: 'SECRET',
token_key:'USERKEY', token_secret:'USERSECRET'
});
##Getting Mentions of your Accountbot.mentions(40, function(err, response) {
if (err) {console.log(err); return;}
for (var i = 0, l = response.length; i < l; i++) {
console.log('[MENTION] '+response[i].text);
}
});
The above code will retrieve the 40 most recent mentions of your bot, and print their text to
the console. There's a lot more data in that response object for you to play around with
but that's the simplest approach.