updated for Github's API Token

This commit is contained in:
Tomasz Kapias 2024-02-07 20:16:02 +01:00
parent 4de2e0be8c
commit 19146806b9

View file

@ -1,15 +1,15 @@
# gh-starred-to-opml
Generates OPML 2.0 files to track the syndication of Releases from your favorite Github repositories. In their whole or by listings.
Generates OPML 2.0 files to track the syndication of Releases (binaries or tags) from your favorite Github repositories. In their whole or by listings.
----
## Introduction
Each repository's Releases page on Github has a [link](https://github.com/user/repository/releases.atom) to an atom file.
Each repository's Releases page on Github is linked to 2 atom files: [releases](https://github.com/user/repository/releases.atom) and [tags](https://github.com/user/repository/tags.atom) .
This **syndication feeds** allows, among other things :
Those **syndication feeds** allows, among other things :
- to monitor the appearance of new releases,
- without having to bother with notifications,
- to monitor the disappearance of a repository.
@ -22,6 +22,8 @@ Moreover with the recent feature of **[starred repositories lists](https://githu
- But, a **2nd issue** is that the **[API does not yet provide](https://github.com/community/community/discussions/8293)** an endpoint to **filter the starred repositories by the user's personal Lists**.
- In addition, **Github's API has a rate limit for anonymous requests** of 60 per hour and per IP. You need to use a Token to push this limit between 1000 and 5000 per hour and per IP.
**gh-starred-to-opml is a solution**, it's a bash script that will fetch these informations for you and generate a file that can be imported in most Feed Reader applications, like the selfhosted and open source [Miniflux](https://github.com/miniflux/v2).
@ -31,7 +33,7 @@ Moreover with the recent feature of **[starred repositories lists](https://githu
- curl (sudo apt install curl)
- [jq](https://github.com/stedolan/jq/) (sudo apt install jq)
- [pup](https://github.com/ericchiang/pup) (go install github.com/ericchiang/pup@latest)
- A Github [personal access token](https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api?apiVersion=2022-11-28#basic-authentication).
## Usage
@ -39,8 +41,9 @@ Moreover with the recent feature of **[starred repositories lists](https://githu
./gh-starred-to-opml.sh -h
Generate an OPML 2.0 file to follow releases of starred repositories on Github
Default to all starred repos of the user, or a specific list with [-l list].
Uses the Github API to check lists and if the starred repos contain Release (preferred) or Tag entries.
Syntax: ./gh-starred-to-opml.sh [-h] -u user [-l listname] [-d date] [-o filename] [-n filename]
Syntax: ./gh-starred-to-opml.sh [-h] -u user [-l listname] [-d date] [-o filename] [-n filename] -t token
options:
-h Print this Help
-u string required: Github username
@ -50,12 +53,10 @@ options:
-n string.opml Use a previous file to generate updates,
it does not require any other option,
but it uses starred_at dates, not starred in a list.
-t string required: Github API token to avoid rate limits.
```
The resulting file can be imported in a Feed Reader.
- The first `<outline text="">` will provide the category's name.
- `<dateCreated>` & `<dateModified>` respresent the oldest & most recent dates where repositories in the list where starred. It can help for updates.
- The whole `<head>` is parsed by the update option (-n) to do without any other option.
- The resulting file can be imported in a Feed Reader.
## Example
@ -88,4 +89,3 @@ Cropped OPML extract from my Favorites list:
## To be done
- Replace jq by [jaq](https://github.com/01mf02/jaq), which is much faster.
- The update option should compare the previous OPML file to find repositories that were already starred but appeared in another List. Currently the update option consider only the date where the repository was starred globaly.