-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from KCreate/master
Fix for GitHub public stats changes
- Loading branch information
Showing
3 changed files
with
153 additions
and
170 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
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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
{ | ||
"name": "gh-scrape", | ||
"version": "1.0.10", | ||
"version": "1.0.2", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "node test" | ||
}, | ||
"author": "Shikkic", | ||
"license": "ISC", | ||
"dependencies": { | ||
"cheerio": "^0.19.0", | ||
"moment": "^2.11.2", | ||
"request": "^2.64.0", | ||
"underscore": "^1.8.3" | ||
"request": "^2.64.0" | ||
} | ||
} |
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,22 @@ | ||
const gh = require('./index'); | ||
const url = '/~https://github.com/KCreate'; | ||
|
||
gh.scrapeContributionDataAndStats(url, (data) => { | ||
if (Object.keys(data.statsData).length > 0) { | ||
console.log('[ OK ] Test 1 passed!'); | ||
} else { | ||
console.log('[ FAIL ] Test 1 failed!'); | ||
} | ||
|
||
console.log(data); | ||
}); | ||
|
||
|
||
// These just fail if they are being run. | ||
// The implementation is supposed to show a deprecation warning | ||
gh.scrapeContributionData(url, (data) => { | ||
console.log('[ FAIL ] Test 2 failed'); | ||
}); | ||
gh.scrapeContributionStats(url, (data) => { | ||
console.log('[ FAIL ] Test 3 failed'); | ||
}); |