Skip to content

Commit

Permalink
Release v0.4.3 (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
5ouma committed Jul 6, 2024
1 parent d4d3c83 commit 39b88ae
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 18 deletions.
36 changes: 24 additions & 12 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ OPML Generator has 2 ways to convert TOML to OPML.
git clone https://github.com/5ouma/opml-generator.git
```

3. Run Deno Task
3. Set the environment variables if you prefer

> [🌍 Environment Variables](#-environment-variables)
4. Run Deno Task

```shell
deno task gen
```

4. Outputs are stored in the `outputs` directory separated by `lists`
5. Outputs are stored in the `outputs` directory separated by `lists`

<br />

Expand All @@ -50,23 +54,31 @@ OPML Generator has 2 ways to convert TOML to OPML.
- includes [`feeds.toml`](./assets/example/feeds.toml)
- for outputs

2. Create [a Personal Access Token] with the `Gist` permission
2. [Fork this repository](https://github.com/5ouma/opml-generator/fork)

3. [Fork this repository](https://github.com/5ouma/opml-generator/fork)
3. Add Actions secrets
from `Settings > Secrets and variables | Actions` in the sidebar

4. Add Actions secrets
from `Settings > Secrets and variables | Actions` in the sidebar:
> [🌍 Environment Variables](#-environment-variables)
- `TOML_GIST_ID`: Gist ID for [`feeds.toml`](./assets/example/feeds.toml)
- `OPML_GIST_ID`: Gist ID for outputs
- `TOKEN`: Personal Access Token

5. Enable GitHub Actions by checking `Allow all actions and reusable workflows`
4. Enable GitHub Actions by checking `Allow all actions and reusable workflows`
from `Settings > Actions | General` in the sidebar

🎉 Automatically update every 0 a.m. UTC

[a Personal Access Token]: https://github.com/settings/tokens
<br /><br />

## 🌍 Environment Variables

| Name | Description | GitHub Actions only |
| :-------------: | :------------------------: | :-----------------: |
| `TOML_GIST_ID` | Gist ID for [`feeds.toml`] | true |
| `OPML_GIST_ID` | Gist ID for outputs | true |
| `TOKEN` | [Personal Access Token] | true |
| `NITTER_DOMAIN` | Nitter RSS domain | false |

[`feeds.toml`]: ./assets/example/feeds.toml
[Personal Access Token]: https://github.com/settings/tokens/new?description=OPML%20Generator&scopes=gist

<br /><br />

Expand Down
8 changes: 8 additions & 0 deletions .github/assets/example/feeds.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ title = "bluesky"
type = "bluesky"
id = "username"
[[lists.feeds]]
title = "nitter"
type = "nitter"
id = "example tweet search"
[[lists.feeds]]
title = "note"
type = "note"
id = "username"
Expand All @@ -28,3 +32,7 @@ id = "subreddit-name"
title = "sizu.me"
type = "sizu.me"
id = "username"
[[lists.feeds]]
title = "zenn"
type = "zenn"
id = "username"
1 change: 1 addition & 0 deletions .github/workflows/deps-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ jobs:
base: dev
branch: deps-deno
commit-prefix: "chore(deps):"
labels:
2 changes: 1 addition & 1 deletion .github/workflows/gist-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: 🦕 Setup Deno
uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba # v1.1.4
uses: denoland/setup-deno@f99b7edee36540f7183c45aad62fbb93d6d41d9d # v1.2.0
with:
deno-version: v1.x

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: 🦕 Setup Deno
uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba # v1.1.4
uses: denoland/setup-deno@f99b7edee36540f7183c45aad62fbb93d6d41d9d # v1.2.0
with:
deno-version: v1.x

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
args: [--whitespaces-count, "2"]

- repo: https://github.com/crate-ci/typos
rev: v1.22.7
rev: v1.22.9
hooks:
- id: typos

Expand Down
5 changes: 3 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"fmt": { "exclude": ["LICENSE", ".github/**/*.md"] },
"test": { "include": ["src/", "test/"] },
"tasks": {
"gen": "deno run --allow-read --allow-write ./src/main.ts",
"test": "deno test --allow-read --allow-write --parallel --shuffle",
"gen": "deno run --allow-env --allow-read --allow-write ./src/main.ts",
"test": "deno test --allow-env --allow-read --allow-write --parallel --shuffle",
"cov": "deno task test --coverage && deno coverage --lcov > coverage.lcov"
},
"imports": {
Expand All @@ -15,6 +15,7 @@
"@std/cli": "jsr:@std/[email protected]",
"@std/path": "jsr:@std/[email protected]",
"@std/toml": "jsr:@std/[email protected]",
"@std/url": "jsr:@std/[email protected]",
"@wok/case": "jsr:@wok/[email protected]"
}
}
12 changes: 12 additions & 0 deletions deno.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"jsr:@std/collections@^1.0.0-rc.1": "jsr:@std/[email protected]",
"jsr:@std/internal@^1.0.0": "jsr:@std/[email protected]",
"jsr:@std/[email protected]": "jsr:@std/[email protected]",
"jsr:@std/[email protected]": "jsr:@std/[email protected]",
"jsr:@std/[email protected]": "jsr:@std/[email protected]",
"jsr:@std/[email protected]": "jsr:@std/[email protected]",
"jsr:@wok/[email protected]": "jsr:@wok/[email protected]"
},
"jsr": {
Expand Down Expand Up @@ -44,12 +46,21 @@
"jsr:@std/assert@^0.226.0"
]
},
"@std/[email protected]": {
"integrity": "b8c00ae2f19106a6bb7cbf1ab9be52aa70de1605daeb2dbdc4f87a7cbaf10ff6"
},
"@std/[email protected]": {
"integrity": "c364b9ca3b18207223c4e2a1f652ef2970ff80967f7575ddf89b6b0565a17148",
"dependencies": [
"jsr:@std/collections@^1.0.0-rc.1"
]
},
"@std/[email protected]": {
"integrity": "19f0e1c6ff8fc2ef9522a746595c24f53be47425daa910eb8ef39cbb5e00b3df",
"dependencies": [
"jsr:@std/[email protected]"
]
},
"@wok/[email protected]": {
"integrity": "409e94f961f5b278992bace87a0c7d3c6a3db516d01759bdb827d9ae4d75e9aa"
}
Expand All @@ -63,6 +74,7 @@
"jsr:@std/[email protected]",
"jsr:@std/[email protected]",
"jsr:@std/[email protected]",
"jsr:@std/[email protected]",
"jsr:@wok/[email protected]"
]
}
Expand Down
13 changes: 12 additions & 1 deletion src/libs/sites.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { join } from "@std/url";
import type { site } from "@5ouma/opml-generator/types";

const sites: site[] = [
{ type: "bluesky", url: new URL("https://bsky.app/profile/{id}/rss") },
{
type: "nitter",
url: join(
new URL(`https://${Deno.env.get("NITTER_DOMAIN") ?? "cdn.xcancel.com"}`),
"/search/rss?f=tweets&q={id}",
),
},
{ type: "note", url: new URL("https://note.com/{id}/rss") },
{ type: "reddit", url: new URL("https://www.reddit.com/r/{id}/.rss") },
{ type: "sizu.me", url: new URL("https://sizu.me/{id}/rss") },
{ type: "zenn", url: new URL("https://zenn.dev/{id}/feed") },
];

export function transcodeXmlUrl(
Expand All @@ -19,5 +28,7 @@ export function transcodeXmlUrl(
.find((site: site) => site.type === type)?.url;
if (!url) throw new Error(`site not found: "${type}" of "${title}"`);

return new URL(url.href.replace(encodeURI("{id}"), id));
return new URL(
url.href.replace(encodeURI("{id}"), id).replaceAll("%3F", "?"),
);
}

0 comments on commit 39b88ae

Please sign in to comment.