Skip to content

Commit 10c49ea

Browse files
committed
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
1 parent 7426a3d commit 10c49ea

File tree

2 files changed

+138
-130
lines changed

2 files changed

+138
-130
lines changed

.src/notes/figures.md

Lines changed: 69 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ Since I don't feel like actually making an account on _[myfigurecollection.net][
1515
[mfc]: https://myfigurecollection.net
1616

1717
## Collection
18-
_Sorted by when I remember getting it, from newest to oldest.<br/>
19-
If images are broken it means MFC is down again._
18+
_Sorted by when I remember getting it, from newest to oldest._
2019

2120
<div id="fig-thumbs">
2221
<noscript>
@@ -32,8 +31,8 @@ If images are broken it means MFC is down again._
3231

3332
| Key | Meaning |
3433
| -- | -- |
35-
| ![ico-fig](https://static.myfigurecollection.net/upload/items/186.jpg) | **Owned** |
36-
| ![ico-fig-fake](https://static.myfigurecollection.net/upload/items/186.jpg) | **Owned (Fake/Bootleg)** |
34+
| ![ico-fig](https://static.myfigurecollection.net/upload/items/0/186-f9170.jpg) | **Owned** |
35+
| ![ico-fig-fake](https://static.myfigurecollection.net/upload/items/0/186-f9170.jpg) | **Owned (Fake/Bootleg)** |
3736

3837
</div>
3938

@@ -91,73 +90,76 @@ _(I keep this gallery around mostly so I can gawk at people's gigantic miku coll
9190
'use strict';
9291

9392
var figs = [
94-
/* MFC ids prepended with x are knockoffs */
93+
/* MFC id, unknown MFC image hash key, alt text description
94+
* MFC ids prepended with x are knockoffs
95+
*/
9596

9697
/*
97-
[ '1536230', 're-ment miku miku ♪ room miniature #1 of 8' ],
98-
[ '1536252', 're-ment miku miku ♪ room miniature #2 of 8' ],
99-
[ '1536231', 're-ment miku miku ♪ room miniature #3 of 8' ],
100-
[ '1536233', 're-ment miku miku ♪ room miniature #4 of 8' ],
101-
[ '1536234', 're-ment miku miku ♪ room miniature #5 of 8' ],
102-
[ '1536236', 're-ment miku miku ♪ room miniature #6 of 8' ],
103-
[ '1536237', 're-ment miku miku ♪ room miniature #7 of 8' ],
104-
[ '1536238', 're-ment miku miku ♪ room miniature #8 of 8' ],
105-
98+
[ '1536230', '57dd2', 're-ment miku miku ♪ room miniature #1 of 8' ],
99+
[ '1536252', '08790', 're-ment miku miku ♪ room miniature #2 of 8' ],
100+
[ '1536231', '9277b', 're-ment miku miku ♪ room miniature #3 of 8' ],
101+
[ '1536233', '7ee99', 're-ment miku miku ♪ room miniature #4 of 8' ],
102+
[ '1536234', '4c1f3', 're-ment miku miku ♪ room miniature #5 of 8' ],
103+
[ '1536236', '79c77', 're-ment miku miku ♪ room miniature #6 of 8' ],
104+
[ '1536237', 'c53b8', 're-ment miku miku ♪ room miniature #7 of 8' ],
105+
[ '1536238', '0e4a2', 're-ment miku miku ♪ room miniature #8 of 8' ],
106106
*/
107-
[ '1335582', 'sega sakura miku v3 SPM' ],
108-
[ '1571286', 'sega miku christmas 2022 SPM' ],
109-
[ '1479579', 'sega miku 15th anniversary kei ver. SPM' ],
110-
[ '1549222', 'sega miku 15th anniversary zhou ver. SPM' ],
111-
[ '1275355', 'sega preciality special nuigurumi sakura miku' ],
112-
[ '1213389', 'good smile genshin impact venti nendoroid #1795' ],
113-
[ '1189088', 'good smile hatsune miku nt nendoroid #1701' ],
114-
[ '1499800', 'taito miku artist masterpiece latidos 2022 ver.' ],
115-
[ '1220581', 'taito miku artist masterpiece pricess arabian ver.' ],
116-
[ 'x1214387', 'knockoff taito miku wonderland rapunzel' ],
117-
[ 'x314683', 'knockoff sega miku fuwa fuwa nuigurumi plush (strap)' ],
118-
[ 'x370088', 'knockoff sega miku fuwa fuwa mega jumbo nuigurumi plush' ],
119-
[ 'x514129', 'knockoff sega nyanko miku fuwa fuwa mega jumbo nuigurumi plush' ],
120-
[ 'x809190', 'knockoff furyu miku noodle stopper figure' ],
121-
[ 'x2987', 'knockoff max factory figma miku #014' ],
122-
[ '401018', 'sega project diva innocent SPM miku' ],
123-
[ '718192', 'hatsune miku 2nd season Winter ver.' ],
124-
[ '1251026', 'bandai q posket miku type a' ],
125-
[ '944728', 'furyu miku bicute bunnies' ],
126-
[ '1311067', 'taito miku artist masterpiece princess alice' ],
127-
[ '1268909', 'taito miku artist masterpiece 14th anniv.' ],
128-
[ '1293291', 'furyu sakura miku noodle stopper' ],
129-
[ '886807', 'taito sakura miku 2020 ver.' ],
130-
[ '1216990', 'racing miku 2021 espresto' ],
131-
[ '1035745', "sega mega 39's breathe you SPM miku" ],
132-
[ '1112719', 'miku big nuigurumi plush' ],
133-
[ '756832', 'hatsune miku 2nd season Spring ver.' ],
134-
[ '776143', 'hatsune miku 2nd season Summer ver.' ],
135-
[ '4741', 'hatsune miku piano EX figure 2009' ],
136-
[ '1150601', 'miku nesoberi nuigurumi (strap)' ],
137-
[ '798190', 'sega sakura miku SPM' ],
138-
[ '720383', 'sega fate/extella link astolfo SPM' ],
139-
[ '693275', 'miku mega jumbo nuigurumi plush 2018' ],
140-
[ '675904', 'good smile gochiusa sxarp nendoroid #929' ],
141-
[ '689123', 'good smile snow princess miku nendoroid #1000' ],
142-
[ '464596', 'good smile konosuba megumin nendoroid #725' ],
143-
[ '440687', 'sega project diva X SPM miku' ],
144-
[ '583734', 'sega izayoi sakuya prize figure' ],
145-
[ '200768', 'funko pop rocks miku #39' ],
146-
[ '246546', 'sega project diva F2nd miku' ],
147-
[ 'x287774', 'knockoff good smile umaru-chan nendoroid #524' ],
148-
[ 'x26113', 'knockoff good smile snow miku nendoroid #150' ],
149-
[ '198604', 'sega project diva 2nd miku' ],
150-
[ '47413', 'banpresto kogami akira lucky star' ],
151-
[ '167123', 'sega project diva arcade miku 2012' ],
152-
[ '100292', 'hatsune miku plush great eastern 2012' ],
107+
108+
[ '1335582', '45071', 'sega sakura miku v3 SPM' ],
109+
[ '1571286', '13885', 'sega miku christmas 2022 SPM' ],
110+
[ '1479579', '2b77d', 'sega miku 15th anniversary kei ver. SPM' ],
111+
[ '1549222', '51878', 'sega miku 15th anniversary zhou ver. SPM' ],
112+
[ '1275355', '6d5f6', 'sega preciality special nuigurumi sakura miku' ],
113+
[ '1213389', 'b3aa1', 'good smile genshin impact venti nendoroid #1795' ],
114+
[ '1189088', '749c7', 'good smile hatsune miku nt nendoroid #1701' ],
115+
[ '1499800', '5eb8d', 'taito miku artist masterpiece latidos 2022 ver.' ],
116+
[ '1220581', '68abc', 'taito miku artist masterpiece pricess arabian ver.' ],
117+
[ 'x1214387', '2ce6c', 'knockoff taito miku wonderland rapunzel' ],
118+
[ 'x314683', 'dd714', 'knockoff sega miku fuwa fuwa nuigurumi plush (strap)' ],
119+
[ 'x370088', '9e436', 'knockoff sega miku fuwa fuwa mega jumbo nuigurumi plush' ],
120+
[ 'x514129', '953bd', 'knockoff sega nyanko miku fuwa fuwa mega jumbo nuigurumi plush' ],
121+
[ 'x809190', 'f14f9', 'knockoff furyu miku noodle stopper figure' ],
122+
[ 'x2987', '316e0', 'knockoff max factory figma miku #014' ],
123+
[ '401018', '46ea9', 'sega project diva innocent SPM miku' ],
124+
[ '718192', '46a35', 'hatsune miku 2nd season Winter ver.' ],
125+
[ '1251026', '4cdac', 'bandai q posket miku type a' ],
126+
[ '944728', 'e11c7', 'furyu miku bicute bunnies' ],
127+
[ '1311067', '71abf', 'taito miku artist masterpiece princess alice' ],
128+
[ '1268909', '1026e', 'taito miku artist masterpiece 14th anniv.' ],
129+
[ '1293291', '0722b', 'furyu sakura miku noodle stopper' ],
130+
[ '886807', '361bd', 'taito sakura miku 2020 ver.' ],
131+
[ '1216990', 'd5032', 'racing miku 2021 espresto' ],
132+
[ '1035745', '30ee2', "sega mega 39's breathe you SPM miku" ],
133+
[ '1112719', '9eef3', 'miku big nuigurumi plush' ],
134+
[ '756832', 'e2f87', 'hatsune miku 2nd season Spring ver.' ],
135+
[ '776143', '83ba8', 'hatsune miku 2nd season Summer ver.' ],
136+
[ '4741', 'b8f3f', 'hatsune miku piano EX figure 2009' ],
137+
[ '1150601', 'e3581', 'miku nesoberi nuigurumi (strap)' ],
138+
[ '798190', '976e1', 'sega sakura miku SPM' ],
139+
[ '720383', '9fd05', 'sega fate/extella link astolfo SPM' ],
140+
[ '693275', '0efa8', 'miku mega jumbo nuigurumi plush 2018' ],
141+
[ '675904', '9186d', 'good smile gochiusa sxarp nendoroid #929' ],
142+
[ '689123', 'a8cdd', 'good smile snow princess miku nendoroid #1000' ],
143+
[ '464596', '0159f', 'good smile konosuba megumin nendoroid #725' ],
144+
[ '440687', '03e24', 'sega project diva X SPM miku' ],
145+
[ '583734', 'a013e', 'sega izayoi sakuya prize figure' ],
146+
[ '200768', '787a5', 'funko pop rocks miku #39' ],
147+
[ '246546', '3a64c', 'sega project diva F2nd miku' ],
148+
[ 'x287774', '7757e', 'knockoff good smile umaru-chan nendoroid #524' ],
149+
[ 'x26113', '16c9a', 'knockoff good smile snow miku nendoroid #150' ],
150+
[ '198604', '17661', 'sega project diva 2nd miku' ],
151+
[ '47413', 'fbbec', 'banpresto kogami akira lucky star' ],
152+
[ '167123', 'b82e3', 'sega project diva arcade miku 2012' ],
153+
[ '100292', '62674', 'hatsune miku plush great eastern 2012' ],
153154
];
154155

155156
var thumbs = document.getElementById('fig-thumbs');
156157
var gallery = document.getElementById('fig-gallery');
157158

158159
for (var i in figs) {
159160
var id = figs[i][0];
160-
var title = figs[i][1];
161+
var hash = figs[i][1];
162+
var title = figs[i][2];
161163
var alt = 'ico-fig';
162164
if (id.charAt(0) == 'x') {
163165
id = id.slice(1);
@@ -168,12 +170,13 @@ for (var i in figs) {
168170

169171
/* icons */
170172
l1 = document.createElement('a');
171-
l1.href= "https://myfigurecollection.net/item/" + id;
173+
l1.href= 'https://myfigurecollection.net/item/' + id;
172174

173175
l2 = document.createElement('img');
174176
l2.alt = alt;
175177
l2.title = title;
176-
l2.src = "https://static.myfigurecollection.net/upload/items/" + id + ".jpg";
178+
l2.src = 'https://static.myfigurecollection.net/upload/items/0/'
179+
+ id + '-' + hash + ".jpg";
177180
l1.appendChild(l2);
178181

179182
thumbs.appendChild(l1);
@@ -182,10 +185,11 @@ for (var i in figs) {
182185
l1 = document.createElement('p');
183186

184187
l2 = document.createElement('a');
185-
l2.href = "https://myfigurecollection.net/pictures.php?itemId=" + id;
188+
l2.href = 'https://myfigurecollection.net/pictures.php?itemId=' + id;
186189

187190
l3 = document.createElement('img');
188-
l3.src = "https://static.myfigurecollection.net/upload/items/big/" + id + ".jpg";
191+
l3.src = 'https://static.myfigurecollection.net/upload/items/1/'
192+
+ id + '-' + hash + ".jpg";
189193
l3.title = title;
190194
l3.alt = 'nolink';
191195
l2.appendChild(l3);

notes/figures.htm

Lines changed: 69 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)