Simplify xidel global arguments

This commit is contained in:
~lucidiot 2023-10-16 00:53:02 +02:00
parent ecb68f3308
commit 34990d6157
1 changed files with 5 additions and 5 deletions

View File

@ -2,20 +2,20 @@
all: css/sprites.css opml/feeds.opml opml/nhc.opml opml/cta.opml
USER_AGENT:="RSRSSS/1.0 (+https://envs.net/~lucidiot/rsrsss/feed.xml)"
XIDEL_ARGS:=--silent --user-agent=$(USER_AGENT) --wait=1
export XIDEL_OPTIONS:=--silent --user-agent=$(USER_AGENT) --wait=1
opml/feeds.opml: feed.xml xquery/feeds_opml.xqy
xidel $(XIDEL_ARGS) feed.xml --extract-kind=xquery3 --extract-file=xquery/feeds_opml.xqy --output-format=xml > $@
xidel feed.xml --extract-kind=xquery3 --extract-file=xquery/feeds_opml.xqy --output-format=xml > $@
chmod a+r $@
# The page is encoded as latin1 but xidel does not convert it by itself when making an HTTP request, so we use curl
opml/nhc.opml: xquery/nhc_opml.xqy
curl --silent --fail -H User-Agent:$(USER_AGENT) https://www.nhc.noaa.gov/aboutrss.shtml |\
xidel $(XIDEL_ARGS) - --stdin-encoding=iso-8859-1 --extract-kind=xquery3 --extract-file=xquery/nhc_opml.xqy --output-format=xml > $@
xidel - --stdin-encoding=iso-8859-1 --extract-kind=xquery3 --extract-file=xquery/nhc_opml.xqy --output-format=xml > $@
chmod a+r $@
opml/cta.opml: xquery/cta_opml.xqy
xidel $(XIDEL_ARGS) --extract-kind=xquery3 --extract-file=xquery/cta_opml.xqy --output-format=xml > $@
xidel --extract-kind=xquery3 --extract-file=xquery/cta_opml.xqy --output-format=xml > $@
chmod a+r $@
sprites := $(wildcard img/sprites/*.png)
@ -25,5 +25,5 @@ img/sprites.png: $(sprites)
chmod a+r $@
css/sprites.css: img/sprites.png xquery/build_sprites_css.xqy
xidel $(XIDEL_ARGS) --extract-kind=xquery3 --extract-file=xquery/build_sprites_css.xqy > $@
xidel --extract-kind=xquery3 --extract-file=xquery/build_sprites_css.xqy > $@
chmod a+r $@