GitHubのREST-APIを用いて情報を表示します.
以下にPythonでのコード例を示します.
import subprocess as sb
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("--user", required=True, type=str)
parser.add_argument("--repo", required=True, type=str)
args = parser.parse_args()
user_name = args.user
repo_name = args.repo
cmd = f"curl https://api.github.com/repos/{user_name}/{repo_name}/stargazers -H "
cmd += "'Accept: application/vnd.github.v3.star+json' "
cmd += '| grep "starred_at"'
results = sb.check_output(cmd, shell=True).decode().split('"starred_at": ')
cnt = 0
for r in results:
timestamp = r.split(',')[0][1:-1][:10]
if "20" in timestamp:
cnt += 1
print(f"Star {cnt:0>4}: {timestamp}")