Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
notes/figures: Fixed image scraping to reflect new MFC image API
MFC has changed their image API for the 2nd time since starting this article by appending a hash key of unknown origin to their image filenames. I have to assume it's random, this key is unique to every entry but is the same for every image within the entry. thumbnail endpoints https://static.myfigurecollection.net/upload/items/1335582.jpg https://static.myfigurecollection.net/upload/items/0/1335582-45071.jpg medium size image endpoints https://static.myfigurecollection.net/upload/items/big/1335582.jpg https://static.myfigurecollection.net/upload/items/1/1335582-45071.jpg Endpoints for */large/* images has been changed to */2/*, but some very old entries don't have this size of image and I don't feel like making an XMLHttpRequest for every single entry to check, nor do I want to hardcode it into the script so I still use the new equivalent endpoint for */big/*. (for future reference) * i don't recommend this ham fisted approach i'm just lazy * fetched the new keys with cat figs.txt | while read -r id; do wget -qO- "https://myfigurecollection.net/item/$id" \ | egrep -o "$id-[a-z0-9]+" | head -n 1 done * then did something like paste figs.txt figs2.txt | while read -r old new; do sed "s/$old/$new/g" -i .src/notes/figures.md done * then used nano keystroke macros to massage the rest into JSON i forgot
- Loading branch information
1 parent
7426a3d
commit 10c49ea
Showing
2 changed files
with
138 additions
and
130 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.