A library for verify which following friends on Twitter that are not in your lists.
npm install 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 method returns a Promise with the a list of the names of the unlisted friends.
const unlisted = require('unlisted-friends');
const friends = unlisted.get('Garethderioth', '<PUT YOUR KEY HERE>', '<PUT YOUR KEY HERE>');
friends.then(response => {
console.log(response);
}, error => {
console.log(error);
})
If you have all your friends in list you will get something like:
> [Error: @Garethderioth does not have unlisted friends.]
But if you have unlisted friends you will get something like:
> ['CodePen', 'Miss_Mandaline']
The Twitter API has some rate limits window divided into 15 minute intervals. Learn more about it here. 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.
- Include ES2015 support
- Change the tests to AVA
- Include Istanbul coverage
- Include semantic-release
- Include test and coverage checking
- Include badges