-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Seva Rybakov
committed
Apr 4, 2013
0 parents
commit d50a223
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# github-zen: A tiny utility for reading github zen | ||
A tiny piece of javascript for watching zen streaming from GitHub API | ||
|
||
## Installation | ||
|
||
- Install node.js; | ||
- Clone the repo; | ||
- ```$ npm install```; | ||
- ```$ node zen.js```; | ||
- Watch it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "github-zen", | ||
"version": "1.0.0", | ||
"description": "Fetches github zen citations from https://api.github.com/zen and... well, may ban you for a while", | ||
"main": "zen.js", | ||
"repository": "http://github.com/CodingFu/github-zen", | ||
"keywords": [ | ||
"strange" | ||
], | ||
"author": "Seva Rybakov", | ||
"dependencies": { | ||
"underscore": "~1.4.4", | ||
"request": "~2.16.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var request = require('request') | ||
, _ = require('underscore') | ||
, messages = [] | ||
, limit = 10000 | ||
, i = 0; | ||
|
||
function getZen() { | ||
request('https://api.github.com/zen', function(err, res, body) { | ||
if (err || res.statusCode === 403 || i === limit) { return; } | ||
if (!_.include(messages, body)) { | ||
messages.push(body); | ||
console.log(body); | ||
} | ||
setTimeout(getZen, 300); | ||
}); | ||
} | ||
|
||
getZen(); |