mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
fix # of stargazers and forks on projects
This commit is contained in:
parent
160952965d
commit
468b366145
1 changed files with 6 additions and 16 deletions
|
|
@ -77,6 +77,12 @@
|
||||||
var d = new Date(repo.updatedAt)
|
var d = new Date(repo.updatedAt)
|
||||||
var updated = d.getDate() + ' ' + Months[d.getMonth()] + ', ' + d.getFullYear()
|
var updated = d.getDate() + ' ' + Months[d.getMonth()] + ', ' + d.getFullYear()
|
||||||
text('updated', updated)
|
text('updated', updated)
|
||||||
|
|
||||||
|
data.set('stars', repo.stargazersCount)
|
||||||
|
updateStars(repo.stargazersCount)
|
||||||
|
|
||||||
|
data.set('forks', repo.forksCount)
|
||||||
|
updateN('fork', repo.forksCount)
|
||||||
})
|
})
|
||||||
.fetchLanguages(function(err, langs) {
|
.fetchLanguages(function(err, langs) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
@ -94,22 +100,6 @@
|
||||||
updateContributors(users)
|
updateContributors(users)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fetchWatchers(function(err, users) {
|
|
||||||
if (err) {
|
|
||||||
text('nstar', '?')
|
|
||||||
} else {
|
|
||||||
data.set('stars', users)
|
|
||||||
updateStars(users.length)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.fetchForks(function(err, repos) {
|
|
||||||
if (err) {
|
|
||||||
text('nfork', '?')
|
|
||||||
} else {
|
|
||||||
data.set('forks', repos)
|
|
||||||
updateN('fork', repos.length)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
console.log('hit ' + t + ' (' + (+new Date() - t) + ')')
|
console.log('hit ' + t + ' (' + (+new Date() - t) + ')')
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue