Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watchers_count の廃止に対応 #29

Closed
hackenbacker opened this issue Jun 30, 2022 · 2 comments
Closed

watchers_count の廃止に対応 #29

hackenbacker opened this issue Jun 30, 2022 · 2 comments
Assignees
Labels
bug Something isn't working GitHubAPI API関連の改善案です。

Comments

@hackenbacker
Copy link
Owner

hackenbacker commented Jun 30, 2022

GitHub APIの仕様が変更となり、watchers_count は 廃止となり、
stargazers_countと同じ値がセットされるようになったので、
以下の資料を調査して適切なデータを取得する。

watchers_count の代わりに subscribers_count を使えば良いらしいが、
search-repositories のレスポンスに含まれていなかった。

参考資料

watchers & watchers_count are incorrect
BUG “watchers_count” is the duplicate of “stargazers_count”
Upcoming Changes to Watcher and Star APIs

@hackenbacker hackenbacker added bug Something isn't working GitHubAPI API関連の改善案です。 labels Jun 30, 2022
@hackenbacker hackenbacker self-assigned this Jun 30, 2022
@hackenbacker hackenbacker changed the title watchers_count は subscribers_count に変更する watchers_count を subscribers_count に変更する Jun 30, 2022
@hackenbacker hackenbacker changed the title watchers_count を subscribers_count に変更する watchers_count の廃止に対応 Jul 1, 2022
@hackenbacker hackenbacker added the help wanted Extra attention is needed label Jul 1, 2022
@hackenbacker
Copy link
Owner Author

以下の方法で subscribers_count を取得できる。
1
リポジトリ item から "url" を取得する。

"url": "https://api.github.com/repos/apple/swift"

2
取得した"url"に対してGETを行う。

GET https://api.github.com/repos/apple/swift

3
Responseの中に"subscribers_count"が含まれている。

"subscribers_count": 2526

@hackenbacker hackenbacker removed help wanted Extra attention is needed labels Jul 1, 2022
@hackenbacker
Copy link
Owner Author

[0ea80f5] 対応しました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GitHubAPI API関連の改善案です。
Projects
None yet
Development

No branches or pull requests

1 participant