1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2025-12-10 22:46:12 +00:00

fish: lower manga count, ao3 use xq

This commit is contained in:
Phantop 2025-05-09 12:27:32 -04:00
parent b9f3fdbcf7
commit 6fffabcde7
3 changed files with 5 additions and 4 deletions

View file

@ -83,6 +83,7 @@ a nnn 'nnn -A'
a nsmd 'netsurf (md2html $argv | psub -s .html);:'
a nsp 'netsurf (pandoc $argv -s -t html | psub -s .html);:'
a off shutdown
a outfox 'firejail --private=~/Games/outfox --noprofile ./OutFox'
a pbdl 'gdl (trurl -s host=www.tumblr.com $argv);:'
a pill 's powerpill -Syu'
a png2webp 'fd -e png -x cwebp -z 9 -mt {} -o {.}.webp \; -x rm'

View file

@ -1,8 +1,8 @@
#!/usr/bin/env fish
# For Hatena GigaViewer sites: https://hatena.co.jp/solutions/gigaviewer
set page $argv[1]
set rss (curl $page | yq -rp xml -o json .rss.channel)
set limit 999
set rss (curl $page | xq .rss.channel)
set limit 3
set links (echo $rss | jq -rc .item[] | head -n$limit)
for i in $links

View file

@ -1,8 +1,8 @@
function ao3
grep works/.\*/b $argv | cut -d/ -f3 | uniq | parallel curl -OJL ao3.org/downloads/{}/1.epub
for i in *.epub
set title (tar Oxf $i content.opf | pup | grep -A1 -m1 dc:title | tail -1 | sed 's/^ *//' | tr -d /)
set creator (tar Oxf $i content.opf | pup | grep -A1 -m1 dc:creator | tail -1 | sed 's/^ *//' | tr -d /)
set title (tar Oxf $i content.opf | xq -r .package.metadata[\"dc:title\"])
set creator (tar Oxf $i content.opf | xq -r .package.metadata[\"dc:creator\"][\"#text\"])
mv $i "$creator - $title.epub"
end
end