Sign inSign up

keinos/gofeed-cli

By keinos

Updated over 5 years ago

Parse XML/Atom feed from URL/string to JSON

Image
0

1.8K

keinos/gofeed-cli repository overview

gofeed-cli

gofeed-cli is an implementation of GoFeed as a command line.

The gofeed-cli command parses RSS/Atom feed (XML) into JSON from a given URL/string.

gofeed-cli [ global options ] command [command options] [arguments...]
$ # Parse from URL
$ ./gofeed-cli url https://qiita.com/KEINOS/feed.atom
...

Download

Direct Download Links of Latest Release

OSArchBin NameHardware TestedDownload (Latest Release)
macOSx86_64/AMD64gofeed-cli-darwin-amd64MBP Early 2015DOWNLOAD
Win10x86_64/AMD64gofeed-cli-windows-amd64.exeECS LIVAZ2-4/64-W10Pro (N5000)DOWNLOAD
LinuxArm v5gofeed-cli-linux-arm5QNAP TS-119P+DOWNLOAD
LinuxArm v6gofeed-cli-linux-arm6Raspberry Pi Zero WDOWNLOAD
LinuxArm v7gofeed-cli-linux-arm7Raspberry Pi 3+DOWNLOAD
LinuxArm64gofeed-cli-linux-arm64n/aDOWNLOAD
Linuxx86_64/AMD64gofeed-cli-linux-amd64n/aDOWNLOAD

Basic Usage

$ ./gofeed-cli --help
NAME:
   CLI for GoFeed - Parses Feeds such as XML and Atom to JSON.

USAGE:
   gofeed-cli [global options] command [command options] [arguments...]

VERSION:
   vX.X.X-XXXXX

COMMANDS:
   ParseURL, url        Parse the contents of a given URL into JSON.
   ParseString, string  Parse the contents of a given string into JSON.
   help, h              Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --count value, -c value  Number of items to return. (WIP)
   --json, -j               Returns output in JSON format. (Default)
   --help, -h               show help
   --version, -v            print the version
$ # Parse from URL
$ ./gofeed-cli url https://qiita.com/KEINOS/feed.atom
...
#!/bin/bash

str_feed=$(cat <<'FEED'
<rss version="2.0">
<channel>
<managingEditor>Name of Managing Editor Here</managingEditor>
<itunes:author>Author Name of iTunes Here</itunes:author>
</channel>
</rss>
FEED
)

# Parse from string
echo $(./gofeed-cli string "$str_feed")
$ # Pull image
$ docker pull keinos/gofeed-cli
...
$ # Parse from URL via Docker
$ docker run --rm keinos/gofeed-cli url https://qiita.com/KEINOS/feed.atom
...

Basic Info

Install

Download the binary of your architecture, then rename it to gofeed-cli. If it suits you, place it anywhere in your path.

  • Linux users
    • ARMv5 -> gofeed-cli-linux-arm5
    • ARMv6 -> gofeed-cli-linux-arm6
    • ARMv7 -> gofeed-cli-linux-arm7
    • ARM64 -> gofeed-cli-linux-arm64
    • Intel/x86_64/AMD64 -> gofeed-cli-linux-amd64
  • macOS users
    • Intel/x86_64/AMD64 -> gofeed-cli-darwin-amd64
  • Windows10 users
    • Intel/x86_64/AMD64 -> gofeed-cli-windows-amd64

Build

If you have bash and Docker installed, then you don't need a Golang environment to build the binary. Just run the build-bin.sh script under ./build/ directory and you'll get the compiled binaries in ./bin/

$ ./build/build-bin.sh
...
$ ls -l ./bin
...
  • Tested Docker Version: v19.03.5, 19.03.8 | macOS Mojave 10.14.6 @ MacBookPro Intel Core i5
  • You might need a sudo privilege to run the script.

Development

This repository contains /.devcontainer for Visual Studio Code Remote-Container users.

It allows you to use a Docker container as a Golang-featured development environment in VS Code.

Contribute/Collaborate

  • All the Pull Requests MUST be to gofeed-cli branch.
    • Note that this CLI app is placed on gofeed-cli orphan branch and NOT in master. The master branch is an up-to-date code of the original gofeed, so any PRs to this CLI app must be to gofeed-cli branch.
  • Any contribution/collaboration such as new feature, bug fixing, refactoring, etc. are more than well come!
  • Be nice to others.
  • Issues/comments en Español or 日本語 are "no problemo!”. Be happy!

License

This project is licensed under the MIT License.

Credits

Tag summary

Content type

Image

Digest

Size

10.3 MB

Last updated

over 5 years ago

docker pull keinos/gofeed-cli