Skip to content

Instantly share code, notes, and snippets.

@ashumeow
Created November 26, 2014 05:15
Show Gist options
  • Select an option

  • Save ashumeow/b554c528894e4e94a1cd to your computer and use it in GitHub Desktop.

Select an option

Save ashumeow/b554c528894e4e94a1cd to your computer and use it in GitHub Desktop.
var twitter = function()
{
var twit = new twitter({
consumer_key: 'PtSsmBwqSPtc8zQRDJ3GtbhKj',
consumer_secret: 'CsAsJ8fMDS3EPvhQhLawo8La6MwSiuEm1pAZbEDKDYULQFO513',
access_token_key: '176376243-RgYPr0nf9GWNe7ppxU5fLq9KXbmu5m2AT3qB0Box',
access_token_secret: 'P0V8b94x0Csmw41GubwfI45h9p4gKPNAIWNtMauFtz8vT'
});
twit.stream('filter', { track: 'dog' }, function (stream) {
stream.on('data', function (data) {
console.log(data.text);
});
});
};
@codefoster

Copy link
Copy Markdown

Wait, what? You're setting twit to twitter which you're defining right there? The require('twitter') is what pulls in the dependency on another Node.js module. What I wrote was not pure JavaScript... it was JavaScript on Node.js.

@ashumeow

Copy link
Copy Markdown
Author

Oops! sorry. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment