You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
syui 862875feca
update 0.3.4
11 months ago
.github/workflows update cliv2 11 months ago
.gitignore update cliv2 11 months ago
.travis.yml update 0.3.4 11 months ago
go.mod update 0.2.1 11 months ago
readme.md update 0.3.4 11 months ago
xq.go update 0.3.4 11 months ago

readme.md

xq converts xml to json.

download

$ go get -v github.com/syui/xq

use

$ xq /path/to/rss.xml
[{"title":"Creating a new theme","link":"https://syui.gitlab.io/test-hugo-theme-wave/2016/01/01/creating-a-new-theme/","date":"2018-01-16T00:00:00.000+09:00"}, {"title":"Archive","link":"https://syui.gitlab.io/test-hugo-theme-wave/archive/","date":"2018-01-16T00:00:00.000+09:00"}]

$ xq /path/to/rss.xml|jq .
[
  {
    "title": "Creating a new theme",
    "link": "https://syui.gitlab.io/test-hugo-theme-wave/2016/01/01/creating-a-new-theme/",
    "date": "2018-01-16T00:00:00.000+09:00"
  }
]

build

$ git clone https://github.com/syui/xq
$ cd xq
$ go build -o xq
$ ./xq h

example

$ curl -sLO https://syui.cf/hugo-theme-air/index.xml

$ xq ./index.xml
[{"title":"Creating a new theme","link":"https://syui.gitlab.io/test-hugo-theme-wave/2016/01/01/creating-a-new-theme/","date":"2018-01-16T00:00:00.000+09:00"}, {"title":"Archive","link":"https://syui.gitlab.io/test-hugo-theme-wave/archive/","date":"2018-01-16T00:00:00.000+09:00"}]

$ xq i index.xml
[{
  "title": "Creating a new theme",
  "link": "https://syui.gitlab.io/test-hugo-theme-wave/2016/01/01/creating-a-new-theme/",
  "date": "2018-01-16T00:00:00.000+09:00"
}]

# latest update
$ xq u index.xml
2018-01-23T00:00:00.000+09:00

# latest post
$ xq p index.xml
2018-01-16T00:00:00.000+09:00

# latest item link
$ xq latest link index.xml
https://syui.gitlab.io/test-hugo-theme-wave/2016/01/01/creating-a-new-theme/

# latest item title
$ xq l t index.xml
Creating a new theme

# latest item publish
$ xq l p index.xml
2018-01-16T00:00:00.000+09:00

# latest item description
$ xq l d index.xml

update

  • 0.2.0 : urfave/cli/v2

  • 0.2.1 : option/[a]ll

  • 0.2.2 : option/[p]ublish

  • 0.2.3 : fix option/[i]tem

  • 0.2.4 : option/none, $ xq file.xml

  • 0.3.0 : option/[l]atest, sub-command/{link, title, published, description}, $ xq l link ./index.xml

  • 0.3.1 : fix version, $ xq -v

  • 0.3.2 : add alias sub-command, $ xq l d ./index.xml

  • 0.3.3 : change option/all, $ xq a ./index.xml

  • 0.3.4 : change option/update -> latest, $ xq latest ./index.xml