Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to tweet from the command line with custom messages #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# TwitterBot
A sample Twitter Bot that automatically tweets.
A sample Twitter Bot that will tweet whatever you type to the command line.

## How to use
Call bot.js through Node and type the message you want to tweet to the command line.
Make sure to put your message in quotes if it's more than one word.

Example: `node bot.js "I'm tweeting from the command line!"`

5 changes: 4 additions & 1 deletion bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ var Twit = require('twit');
var config = require('./config');
var T = new Twit(config);

// grab the tweet message from the command line arguments
var msg = process.argv[2];

//the message we want to post
var tweet_message = {
status: 'My First Tweet using #TwitterAPI and #NodeJS'
status: msg
}

//This posts our tweet
Expand Down