npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quidprofollow

v1.2.6

Published

Makes a Twitter bot's (or human user's) follower and followee lists match by following and unfollowing to make it happen.

Downloads

12

Readme

quidprofollow

Makes a Twitter bot's (or human user's) follower and followee lists match by following and unfollowing to make it happen.

Installation

npm install quidprofollow

Usage

var quidprofollow = require('quidprofollow');

quidprofollow(
  {
    twitterAPIKeys: {
      consumer_key: 'asdfkljqwerjasdfalpsdfjas',
      consumer_secret: 'asdfasdjfbkjqwhbefubvskjhfbgasdjfhgaksjdhfgaksdxvc',
      access_token: '9999999999-zxcvkljhpoiuqwerkjhmnb,mnzxcvasdklfhwer',
      access_token_secret: 'opoijkljsadfbzxcnvkmokwertlknfgmoskdfgossodrh'
    }
  },
  function done(error, followed, unfollowed) {
    console.log('Followed:', followed);
    console.log('Unfollowed:', unfollowed);
  }
);

Output:

Followed: [807322189, 17400671, 2911212198]
Unfollowed: [74496732, 1000904942]

You can also pass a followFilter in the opts, which should be a function that takes userIds and calls back with the ids that it is OK to follow.

quidprofollow(
  {
    twitterAPIKeys: config,
    followFilter: function filterUserIdsHigherThan100Million(userIds, done) {
      var okIds = userIds.filter(function isOver100Million(userId) {
        return userId > 100000000;
      });
      callNextTick(done, null, okIds);
    }
  },
  function done(error, followed, unfollowed, filteredOut) {
    console.log('Followed:', followed);
    console.log('Unfollowed:', unfollowed);
    console.log('Filtered out:', filteredOut);
  }
);

Tests

Build Status

Run tests with make test.

Run functional test by creating a config.js (be careful not to check that in anywhere) in the root directory that looks like this:

module.exports = {
  twitter: {
    consumer_key: 'asdfkljqwerjasdfalpsdfjas',
    consumer_secret: 'asdfasdjfbkjqwhbefubvskjhfbgasdjfhgaksjdhfgaksdxvc',
    access_token: '9999999999-zxcvkljhpoiuqwerkjhmnb,mnzxcvasdklfhwer',
    access_token_secret: 'opoijkljsadfbzxcnvkmokwertlknfgmoskdfgossodrh'
  }
};

Then run, make test-functional. In this test, you cannot rely on the assertions to make sure things are working because result depend on the followers and followees of the account at the time you run the test. So, check the console output and make sure it's reasonable. It should looks something like:

Would have followed: { id: 319086998 }
Would have followed: { id: 607793 }
Would have followed: { id: 903200748 }
Would have followed: { id: 114240739 }
Would have followed: { id: 372519518 }
Would have followed: { id: 24047669 }
Would have followed: { id: 37587142 }
Would have followed: { id: 2292747043 }
Would have followed: { id: 2509547241 }
Would have followed: { id: 287422826 }
Would have unfollowed: { id: 14375294 }

License

MIT.