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:

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


Submitted July 14, 2017 at 04:21AM by myshortfriend
via reddit


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s