Comparing version 0.1.0 to 0.1.1
@@ -14,2 +14,6 @@ # Change Log | ||
## 0.1.1 - 2016-10-27 | ||
### Added | ||
- Bug fixes (Github API call and url handling) | ||
## 0.1.0 - 2016-10-27 | ||
@@ -16,0 +20,0 @@ ### Added |
17
index.js
@@ -51,2 +51,3 @@ /* @flow */ | ||
function seedDependencies(obj) { | ||
console.log(obj) | ||
Object.keys(obj) | ||
@@ -68,5 +69,10 @@ .forEach(function(dependency) { | ||
dependency.name = details.name; | ||
dependency.url = details.homepage || details.repository.url.replace(/git\+/, ''); | ||
dependency.url = details.homepage || details.repository ? | ||
details.repository.url.replace(/\w*\+/, '') : '' ; | ||
dependency.description = details.description; | ||
gitStarCount(details.repository.url, dependency); | ||
if (details.repository) { | ||
gitStarCount(details.repository.url, dependency); | ||
} | ||
}); | ||
@@ -76,6 +82,7 @@ } | ||
function gitStarCount(url, dependency) { | ||
var parse = /git.*\:\/\/git@\w*\.*com\/|\w*.*\:\/\/\w*\.*com\/|\.git/g | ||
inCount++; | ||
var httpOptions = { | ||
hostname: 'api.github.com', | ||
path: '/repos/' + url.replace(/git|\+https:\/\/github.com\/|\./g, ''), | ||
path: '/repos/' + url.replace(parse, ''), | ||
method: 'GET', | ||
@@ -101,4 +108,4 @@ headers: {} | ||
} | ||
}) | ||
}); | ||
} |
{ | ||
"name": "backpat", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A simple tool for high-fiving your tech stack", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5732
88