I'm trying to get the same information out of GitHub that's shown on the https://github.com/notifications page. Unfortunately, the standard notifications API doesn't really match that view.
If I get the notifications from that API (even with participating=false
), I don't see all the items visible on the website. On the other hand, the API seems to be based on the last_read_at
idea, and things I've seen on the website don't disappear automatically from the notifications list.
Is there a way (without scraping the website) to obtain the same /notifications
view?
In the left sidebar, under the list of repositories, use the "Manage notifications" drop-down to click Notification settings. On the notifications settings page, choose how you receive notifications when: There are updates in repositories or team discussions you're watching or in a conversation you're participating in.
To get the list of random users, you have to make a request to the /user endpoint, and to get the details of a specific user, you make a request to the /user/{username} endpoint. You can try out the following commands quickly in your terminal with curl to see the results.
### Notifications permission If you want to receive desktop notifications, you can enable them on extension options page. You will then be asked for the notifications permission.
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. In the "Integrations" section of the sidebar, click Email notifications. Type up to two email addresses, separated by whitespace, where you'd like notifications to be sent.
So GitHub's API supports pagination for requests returning lists, so the API will return default of 30 notifications per page. What I suggest is setting the default size to 100 and then start from page 1 and call the next page till there is no results e.g. :
<https://api.github.com/notifications?page=1&per_page=100>; rel="next"
<https://api.github.com/notifications?page=2&per_page=100>; rel="next"
...and so on till you get an empty list then you stop
The rel="next" is a Link Header which is explained here: https://developer.github.com/v3/#pagination
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With