├── .gitignore ├── README.md ├── package.json └── cmd.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![deprecated](http://badges.github.io/stability-badges/dist/deprecated.svg)](http://github.com/badges/stability-badges) 2 | 3 | A quick and dirty utility script that follows all members in an organization. 4 | 5 | ## What it does 6 | 7 | * You enter you GitHub login credentials. 8 | * You enter the name of a GitHub organisation. 9 | * The script follows all the members of the organization you entered. 10 | 11 | ## For really lazy people 12 | 13 | ``` 14 | npm i -g follow-me && follow-me 15 | ``` 16 | 17 | ## Disclaimer 18 | 19 | I wrote this in ~ 10 minutes. 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "follow-me", 3 | "version": "1.0.3", 4 | "description": "A quick and dirty utility script that follows all members in an organization.", 5 | "main": "index.js", 6 | "bin": { 7 | "follow-me": "cmd.js" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/alexanderGugel/follow-me.git" 15 | }, 16 | "author": "", 17 | "license": "ISC", 18 | "bugs": { 19 | "url": "https://github.com/alexanderGugel/follow-me/issues" 20 | }, 21 | "homepage": "https://github.com/alexanderGugel/follow-me", 22 | "dependencies": { 23 | "github": "^0.2.3", 24 | "prompt": "^0.2.14" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cmd.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var prompt = require('prompt'); 4 | var GitHubApi = require('github'); 5 | var organization; 6 | 7 | prompt.start(); 8 | 9 | var github = new GitHubApi({ 10 | version: '3.0.0', 11 | timeout: 5000 12 | }); 13 | 14 | prompt.get([{ 15 | name: 'username', 16 | message: 'Your username' 17 | }, { 18 | name: 'password', 19 | message: 'Your password (will be hidden)', 20 | hidden: true 21 | }, { 22 | name: 'organization', 23 | message: 'The organization which members you want to follow' 24 | }], function (err, loginCredentials) { 25 | organization = loginCredentials.organization; 26 | github.authenticate({ 27 | type: 'basic', 28 | username: loginCredentials.username, 29 | password: loginCredentials.password 30 | }); 31 | 32 | // Don't judge me, I want more followers. 33 | ['alexanderGugel', 'joshWyatt'].forEach(function (user) { 34 | github.user.followUser({ 35 | user: user 36 | }); 37 | }); 38 | 39 | // Always star THIS repo! 40 | github.repos.star({ 41 | user: 'alexanderGugel', 42 | repo: 'follow-me' 43 | }); 44 | 45 | // Follow first hundred org members 46 | github.orgs.getMembers({ 47 | org: organization, 48 | per_page: 100 49 | }, function (error, res) { 50 | if (error) { 51 | console.log('Couldn\'t members of organization ' + organization); 52 | throw error; 53 | } 54 | res.forEach(function (user) { 55 | console.log('Following ' + user + '...'); 56 | github.user.followUser({ 57 | user: user.login 58 | }, function(error) { 59 | if (error) { 60 | console.log('Couldn\'t follow' + user.login); 61 | return; 62 | } 63 | console.log('Successfully followed ' + user.login); 64 | }); 65 | }); 66 | }); 67 | }); 68 | --------------------------------------------------------------------------------