A library for verify which following friends on Twitter that are not in your lists.
npm install --save unlisted-friends
You need to provide your own application keys for use the Twitter API.
- Visit https://dev.twitter.com/apps and register a new application.
- Go to the application Keys and Access Tokens page.
- Click on Create my access token to generate your access tokens.*
- Pass the consumer key and consumer secret as second and third arguments respectively when you use the library.
* The access tokens is for have private permissions for your personal account.
The method returns a Promise with the a list of the names of the unlisted friends.
const unlisted = require('unlisted-friends');
const friends = unlisted.get('glrodasz', '<PUT YOUR KEY HERE>', '<PUT YOUR SECRET HERE>');
friends.then(console.log).catch(console.log);
If you have all your friends in list you will get something like:
> [Error: @glrodasz does not have unlisted friends.]
But if you have unlisted friends you will get something like:
> ['hugeinc', 'auth0']
The Twitter API has some rate limits window divided into 15 minute intervals when you use application-only authentication. Learn more.
The library will print a message with the related error:
> [Error: Rate limit exceeded From Twitter API threw in members module.]
In order to avoid the Twitter API rate limit, this library retrieves only 6000 friends, 15 public lists and 5000 members for each list.
In order to run the tests locally you need to rename the file keys.json.example
to keys.json
and put your consumer and secret keys.