unlisted-friends

1.1.10 • Public • Published

Unlisted Friends

Travis Codecov npm npm

A library for verify which following friends on Twitter that are not in your lists.

Install and setup

npm install --save unlisted-friends

You need to provide your own application keys for use the Twitter API.

  1. Visit https://dev.twitter.com/apps and register a new application.
  2. Go to the application Keys and Access Tokens page.
  3. Click on Create my access token to generate your access tokens.*
  4. 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.

How to use

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.]

Notes

In order to avoid the Twitter API rate limit, this library retrieves only 6000 friends, 15 public lists and 5000 members for each list.

Development

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.

Package Sidebar

Install

npm i unlisted-friends

Weekly Downloads

12

Version

1.1.10

License

MIT

Unpacked Size

30.2 kB

Total Files

31

Last publish

Collaborators

  • glrodasz