Skip to content

Commit 47da9e8

Browse files
committed
Added watchers and forkers totals to repos.
1 parent 39bde95 commit 47da9e8

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

data/db.sqlite

12 KB
Binary file not shown.

migrations/20170624215651-repos-migration.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ module.exports = {
77
url: { type: Sequelize.STRING },
88
languages: { type: Sequelize.STRING },
99
stargazers: { type: Sequelize.INTEGER },
10+
watchers: { type: Sequelize.INTEGER },
11+
forks: { type: Sequelize.INTEGER },
1012
createdAt: { type: Sequelize.DATE }
1113
})
1214
},

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"sequelize-cli": "^2.7.0"
1818
},
1919
"scripts": {
20-
"sequelize": "sequelize"
20+
"sequelize": "sequelize",
21+
"scrape": "node -e \"require('./src/server/services/scraper').scrape()\""
2122
}
2223
}

src/server/models/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ module.exports = {
2727
url: Sequelize.STRING(200),
2828
languages: Sequelize.STRING(1000),
2929
stargazers: Sequelize.INTEGER,
30+
watchers: Sequelize.INTEGER,
31+
forks: Sequelize.INTEGER,
3032
createdAt: Sequelize.DATE,
3133
}, {
3234
timestamps: false

src/server/services/github/queries/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ module.exports = {
7171
stargazers {
7272
total: totalCount
7373
}
74+
watchers {
75+
total: totalCount
76+
}
77+
forks {
78+
total: totalCount
79+
}
7480
createdAt
7581
isPrivate
7682
}

src/server/services/repo/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ module.exports = {
3232
url: repo.url,
3333
languages: repo.languages.nodes.map(l => l.name.toLowerCase()).join(' '),
3434
stargazers: repo.stargazers.total,
35+
watchers: repo.watchers.total,
36+
forks: repo.forks.total,
3537
createdAt: new Date(repo.createdAt)
3638
}))
3739
)

0 commit comments

Comments
 (0)