Created
February 7, 2021 18:26
-
-
Save gwennlbh/85dace13d9a270fcc3335df73efec343 to your computer and use it in GitHub Desktop.
Image collection from 4chan.org using jq, curl, echo and a $BROWSER
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace CHAN with desired 4chan.org/CHAN (eg 'c') and OUTFILE with a .html file to output the gallery to | |
# Be sure that you have defined a $BROWSER | |
curl https://a.4cdn.org/CHAN/catalog.json | jq "[.[].threads[] | {title: .sub?, post: (.last_replies[]? | { img: ((.tim? | tostring) + .ext?), comment: .com? })}]" | jq '[.[] | "<h2>\(.title)</h2><img src=https://i.4cdn.org/CHAN/\(.post.img) />"] | join("<hr>")' > OUTFILE && echo "<style>img{max-width:100vw}</style>" >> OUTFILE && $BROWSER OUTFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment