Created
October 7, 2017 06:01
-
-
Save spences10/74064d83235993b18bc656a6d795f595 to your computer and use it in GitHub Desktop.
List Twitter user account followers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Twit = require('twit') | |
const config = require('./config') | |
const bot = new Twit(config) | |
const listOutFollowers = userName => { | |
bot.get( | |
'followers/ids', | |
{ | |
screen_name: userName, | |
count: 200 | |
}, | |
function getData(err, data, response) { | |
for (let i = 0; i < data.ids.length; i++) { | |
console.log(data.ids[i]) | |
} | |
if (data['next_cursor'] > 0) | |
bot.get( | |
'followers/ids', | |
{ | |
screen_name: userName, | |
count: 200, | |
next_cursor: data['next_cursor'] | |
}, | |
getData | |
) | |
} | |
) | |
} | |
module.exports = listOutFollowers | |
listOutFollowers('droidscott') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment