Help a complete noob out with a Twitter bot project?


Help a complete noob out with a Twitter bot project?

Hi guys, feel free to redirect me if this is the wrong spot for this. Also, I know this type of question gets asked all the time here and over at /r/node, so I apologize for any annoyance.

I'm trying to learn Javascript/node by making a Twitter bot that searches users' profile descriptions for a keyword (in this case an emoji) and adds them to a list.

I'm trying to do this with Twitter's REST APIs, and I could use some guidance.

Here is my code (a whopping 6 lines!):

var twit = require('twit'); var config = require('./config.js'); var Twitter = new twit(config); Twitter.get('users/search', {q: '🌹', count: 100}, function(error, data, response) { console.log(data) }) 

Right now, this runs, but returns no data in cmd.

Also, Twitter's documentation talks about using a search URL such as this: https://api.twitter.com/1.1/search/tweets.json?q=%40twitterapi

But I have no idea where this would go in my code, if it goes in there at all.

Thanks!

Submitted July 14, 2017 at 04:21AM by myshortfriend
via reddit http://ift.tt/2t8BVyu

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s