Skip to content

Commit

Permalink
fix🐛: update data for json lang
Browse files Browse the repository at this point in the history
  • Loading branch information
isboyjc committed Aug 1, 2024
1 parent a5bb48a commit 9f2a7c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
33 changes: 15 additions & 18 deletions script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,19 @@ function delay(ms) {
}

(async () => {
// await run('daily', 'all')
// await run('weekly', 'all')
// await run('monthly', 'all')

// let languages = readFileSync(path.resolve(__dirname, DATA_BASE_URL, 'languages.json'), 'utf8');
// languages = JSON.parse(languages);

// console.log("Number of languages: ", languages.length)

// for(const langObj of languages){
// await delay(5 * 60)
// await run('daily', convertToSlug(langObj.name))
// await run('weekly', convertToSlug(langObj.name))
// await run('monthly', convertToSlug(langObj.name))
// }
await run('daily', 'json')
await run('weekly', 'json')
await run('monthly', 'json')
await run('daily', 'all')
await run('weekly', 'all')
await run('monthly', 'all')

let languages = readFileSync(path.resolve(__dirname, DATA_BASE_URL, 'languages.json'), 'utf8');
languages = JSON.parse(languages);

console.log("Number of languages: ", languages.length)

for(const langObj of languages){
await delay(5 * 60)
await run('daily', convertToSlug(langObj.name))
await run('weekly', convertToSlug(langObj.name))
await run('monthly', convertToSlug(langObj.name))
}
})();
2 changes: 0 additions & 2 deletions script/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ function parse(data){
const addStars = $(elm).find('span').last().text().match(/\d+/g)[0]
const contributors = $(elm).find(`a[data-hovercard-type="user"] .avatar.avatar-user`).map((_ ,user) => {
const name = $(user).attr('alt').replace(/^@/, '')
// const url = BASE_URL + $(user).attr('href')
const url = `${BASE_URL}/${name}`
// console.log(url)
return {
avatar: $(user).attr('src'),
name,
Expand Down

0 comments on commit 9f2a7c2

Please sign in to comment.