Skip to content

Instantly share code, notes, and snippets.

@Layzie
Last active December 25, 2015 09:29
Show Gist options
  • Save Layzie/6954298 to your computer and use it in GitHub Desktop.
Save Layzie/6954298 to your computer and use it in GitHub Desktop.
follow SassConf speakers
#!/usr/bin/env node
// vim: set tabstop=2 shiftwidth=2 softtabstop=2 expandtab :
/* jshint indent:2 */
/* global require */
var scraper = require('scraper'),
GitHubApi = require('github'),
usersId = [], github;
scraper('http://sassconf.com/schedule/', function (err, $) {
if (err) { throw err; }
var links = $('.social a[href^="https://github.com/"]');
links.each(function () {
usersId.push($(this).attr('href').split('/')[3]);
});
console.log(usersId);
});
github = new GitHubApi({
version: '3.0.0',
debug: true,
protocol: 'https',
timeout: 5000
});
github.authenticate({
type: 'basic',
username: 'Your Username',
password: 'Your Password'
});
setTimeout(function () {
usersId.forEach(function (name) {
github.user.followUser({
user: name
}, function (err, res) {
console.log(JSON.stringify(res));
});
});
}, 4000);
{
"name": "follow_sassconf2013",
"version": "0.0.0",
"description": "follow at github in sassconf2013's speakers",
"main": "index.js",
"scripts": {
"test": "npm test"
},
"repository": "https://gist.github.com/Layzie/6954298",
"author": "HIRAKI Satoru",
"license": "MIT",
"dependencies": {
"scraper": "0.0.9",
"github": "~0.1.8"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment