Skip to content

Commit

Permalink
doc: add description for import command
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed Aug 24, 2024
1 parent 3513a25 commit f77dff7
Show file tree
Hide file tree
Showing 3 changed files with 315 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,21 @@ You can check the JSON schema of the data to be exported with `synd export --pri
```
</details>
### Import feeds
You can subscribe to multiple feeds at once using the `synd import` command.
The input schema is the same as that of `synd export`. You can also check it with `synd import --print-schema`.
```
# from stdin
echo '{"feeds": [ {"url": "https://this-week-in-rust.org/atom.xml", "category": "rust", "requirement": "Must" } ]}'
| synd import -
# read from file
synd export out> feeds.json
synd import feeds.json
```
### GitHub Notifications
To enable GitHub notifications feature, specify the `--enable-github-notification | -G` flag or set the environment variable `SYND_ENABLE_GH=true`.
Expand Down
292 changes: 292 additions & 0 deletions backup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
{
"feeds": [
{
"title": "κeenのHappy Hacκing Blog",
"url": "https://keens.github.io/index.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "Cloud Native Computing Foundation",
"url": "https://www.cncf.io/feed/",
"requirement": "May",
"category": "cloud"
},
{
"title": "Inside Rust Blog",
"url": "https://blog.rust-lang.org/inside-rust/feed.xml",
"requirement": "Must",
"category": "rust"
},
{
"title": "Happy developing",
"url": "https://blog.ymgyt.io/atom.xml",
"requirement": "May",
"category": "rust"
},
{
"title": "I hate reality",
"url": "https://blog.ihatereality.space/rss.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "eBPF - The latest news, updates and articles covering eBPF and related topics.",
"url": "https://ebpf.io/blog/rss.xml",
"requirement": "Must",
"category": "ebpf"
},
{
"title": "Cybernetist",
"url": "https://cybernetist.com/index.xml",
"requirement": "May",
"category": "rust"
},
{
"title": "Without boats, dreams dry up",
"url": "https://without.boats/index.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "observability news",
"url": "https://buttondown.email/o11y.news/rss",
"requirement": "Must",
"category": "opentelemetry"
},
{
"title": "baby steps",
"url": "https://smallcultfollowing.com/babysteps/index.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "The Embedded Rustacean Blog",
"url": "https://apollolabsblog.hashnode.dev/rss.xml",
"requirement": "May",
"category": "rust"
},
{
"title": "crates.io: opentelemetry releases",
"url": "https://static.crates.io/rss/crates/opentelemetry.xml",
"requirement": "May",
"category": "rust"
},
{
"title": "paild tech blog",
"url": "https://techblog.paild.co.jp/feed",
"requirement": "Should",
"category": "rust"
},
{
"title": "Nushell",
"url": "https://www.nushell.sh/atom.xml",
"requirement": "Should",
"category": "nu"
},
{
"title": "Terminal Trove",
"url": "https://terminaltrove.com/blog.xml",
"requirement": "May",
"category": "linux"
},
{
"title": "Brendan Gregg's Blog",
"url": "https://www.brendangregg.com/blog/rss.xml",
"requirement": "Must",
"category": "linux"
},
{
"title": "shift.click",
"url": "https://shift.click/feed.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "2024 on OpenTelemetry",
"url": "https://opentelemetry.io/blog/2024/index.xml",
"requirement": "Must",
"category": "opentelemetry"
},
{
"title": "OpenTelemetry グループの新着イベント",
"url": "https://opentelemetry.connpass.com/ja.atom",
"requirement": "Should",
"category": "opentelemetry"
},
{
"title": "Rust Blog",
"url": "https://blog.rust-lang.org/feed.xml",
"requirement": "Must",
"category": "rust"
},
{
"title": "Rust Magazine",
"url": "https://rustmagazine.org/feed.xml",
"requirement": "May",
"category": "rust"
},
{
"title": "Mostly nerdless",
"url": "https://mostlynerdless.de/feed/",
"requirement": "Should",
"category": "ebpf"
},
{
"title": "eBPF Meetup グループの新着イベント",
"url": "https://ebpf.connpass.com/ja.atom",
"requirement": "Must",
"category": "ebpf"
},
{
"title": "O'Reilly Japan Ebook Store - New Release",
"url": "https://www.oreilly.co.jp/ebook/new_release.atom",
"requirement": "Should",
"category": "book"
},
{
"title": "Determinate Systems",
"url": "https://determinate.systems/rss.xml",
"requirement": "Should",
"category": "nix"
},
{
"title": "Julia Evans",
"url": "https://jvns.ca/atom.xml",
"requirement": "Should",
"category": "linux"
},
{
"title": "Amazon EKS Document History",
"url": "https://docs.aws.amazon.com/eks/latest/userguide/doc-history.rss",
"requirement": "Should",
"category": "cloud"
},
{
"title": "Kobzol’s blog",
"url": "https://kobzol.github.io/feed.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "Publickey",
"url": "https://www.publickey1.jp/atom.xml",
"requirement": "May",
"category": "linux"
},
{
"title": "Helix editor",
"url": "https://www.reddit.com/r/HelixEditor.rss",
"requirement": "May",
"category": "helix"
},
{
"title": "Orhun's Blog",
"url": "https://blog.orhun.dev/rss.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "Kubernetes Blog",
"url": "https://kubernetes.io/feed.xml",
"requirement": "Should",
"category": "kubernetes"
},
{
"title": "COCl2's blog home",
"url": "https://blog.cocl2.com/index.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "Aurorans Solis’ Blog",
"url": "https://auroranssolis.github.io/feed.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "fasterthanli.me",
"url": "https://fasterthanli.me/index.xml",
"requirement": "Must",
"category": "rust"
},
{
"title": "This Cute World",
"url": "https://thiscute.world/en/index.xml",
"requirement": "Must",
"category": "nix"
},
{
"title": "axo blog",
"url": "https://blog.axo.dev/rss.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "RustSec Advisories",
"url": "https://rustsec.org/feed.xml",
"requirement": "May",
"category": "rust"
},
{
"title": "Kubernetes Vulnerability Announcements - CVE Feed",
"url": "https://kubernetes.io/docs/reference/issues-security/official-cve-feed/feed.xml",
"requirement": "May",
"category": "kubernetes"
},
{
"title": "This Week in Rust",
"url": "https://this-week-in-rust.org/atom.xml",
"requirement": "Must",
"category": "rust"
},
{
"title": "Xe Iaso's blog",
"url": "https://xeiaso.net/blog.json",
"requirement": "Should",
"category": "linux"
},
{
"title": "AWS News Blog",
"url": "https://feeds.feedburner.com/AmazonWebServicesBlog",
"requirement": "May",
"category": "cloud"
},
{
"title": "Byron Wasti - Posts",
"url": "https://www.byronwasti.com/atom.xml",
"requirement": "Should",
"category": "rust"
},
{
"title": "David Lattimore’s Blog",
"url": "https://davidlattimore.github.io/feed.xml",
"requirement": "Must",
"category": "rust"
},
{
"title": "seanmonstar",
"url": "https://seanmonstar.com/rss",
"requirement": "Should",
"category": "rust"
},
{
"title": "/r/nix",
"url": "https://www.reddit.com/r/Nix.rss",
"requirement": "May",
"category": "nix"
},
{
"title": "ゆううきブログ",
"url": "https://blog.yuuk.io/feed",
"requirement": "Should",
"category": "sre"
},
{
"title": "Mara's Blog",
"url": "https://blog.m-ou.se/index.xml",
"requirement": "Must",
"category": "rust"
}
]
}
10 changes: 8 additions & 2 deletions crates/synd_term/src/cli/command/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct ImportCommand {
cache_dir: PathBuf,
/// Path to input file, '-' means stdin.
#[arg()]
input: PathBuf,
input: Option<PathBuf>,
}

impl ImportCommand {
Expand All @@ -68,10 +68,16 @@ impl ImportCommand {
}

async fn import(self, endpoint: Url) -> anyhow::Result<()> {
let input = match self.input {
Some(input) => Self::read_input(input.as_path())?,
None => {
anyhow::bail!("input file path required")
}
};
let cx = PortContext::new(endpoint, self.cache_dir).await?;
let import = Import {
client: cx.client,
input: Self::read_input(self.input.as_path())?,
input,
out: io::stdout(),
interval: Duration::from_millis(500),
};
Expand Down

0 comments on commit f77dff7

Please sign in to comment.