VChet / StyleBase

UserCSS theme sharing site
https://stylebase.cc
MIT License
20 stars 1 forks source link

get "last updated" attribute per-style instead of per-repo #8

Closed RiedleroD closed 3 years ago

RiedleroD commented 3 years ago

All of my styles are displayed as "updated 4 days ago", and while this does increase visiblilty of my styles, which is nice, it doesn't represent them very well. E.g. Dark Grimm hasn't been updated in over a year, and is technically abandoned.

VChet commented 3 years ago

Git itself doesn't store file timestamps. The last modified date showed on GitHub is being parsed through commit history, but it's not available via GitHub API.

To get the last modified datestamp manually, it requires to request a list of all repository commits(1), then request data of each commit(2), and then look for a specific file in a changed files list. It will greatly increase the number of requests to GitHub and request rate limit will be reached even with a small list of repositories.

I'm not going to implement it with the said logic. Maybe someday it will be added to GitHub API or someone will prove me wrong and show me how to get it from the current API in an easier way.

RiedleroD commented 3 years ago

well shucks. Would've been pretty neat, but yeah, that's a pretty solid argument to not implement it. I'm gonna look into the API for a bit anyway, mostly because I'm interested, but also because two pairs of eyes are always better than one.

edit: unsurprisingly, I didn't find anything