sveltesociety.dev
sveltesociety.dev copied to clipboard
Periodically update components and boilerplates data
We should run a script that periodically that updates the site's data. E.g. number of stars that a repo has, last date the repo was updated, etc. Also, I noticed an archived repo on the components page in https://github.com/svelte-society/sveltesociety-2021/pull/15, which is something we could detect as well
The main Svelte site gets info from GitHub to get the list of contributors.
GraphQL API
It looks to me like this has a much higher rate limit than the REST API. However, authentication is required.
You can get 500,000 nodes in one call. It has a rate limit of 5,000 points per hour. I think that translates into being able to load 500,000 repos / hr since the things we care about like pushedAt and stargazerCount are on the same node. https://docs.github.com/en/graphql/overview/resource-limitations
REST API
Info about the Github API rate limit is here: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
- Unauthenticated - 60 requests / hr
- GitHub Actions - 1,000 requests / hr
- Logged in users - 5,000 requests / hr
It looks like you can only get one repo at a time: https://docs.github.com/en/rest/reference/repos#get-a-repository
This is definitely something we need. I'm open to any of the solutions but it does sound like GraphQL API is the way to go. Does it make sense to run it in a GitHub Action? Other ideas?
I am working on a script for this using the GraphQL API.