Change most of the image URLs to point to the archived images.
Chris Pressey
6 years ago
9 | 9 | |
10 | 10 | ### Russki Duck |
11 | 11 | |
12 |  | |
12 |  | |
13 | 13 | |
14 | 14 | * written by: [Nasir Gebelli](https://en.wikipedia.org/wiki/Nasir_Gebelli) |
15 | 15 | * genre: Graphic Adventure |
33 | 33 | |
34 | 34 | ### Beer Run |
35 | 35 | |
36 |  | |
36 |  | |
37 | 37 | |
38 | 38 | * written by: Mark Turmell |
39 | 39 | * published by: Sirius Software, Inc |
66 | 66 | |
67 | 67 | ### Swashbuckler |
68 | 68 | |
69 |  | |
69 |  | |
70 | 70 | |
71 | 71 | * written by: Paul Stephenson |
72 | 72 | * published by: Datamost |
85 | 85 | |
86 | 86 | ### Star Maze |
87 | 87 | |
88 |  | |
88 |  | |
89 | 89 | |
90 | 90 | * written by: Eastman Computing(?) |
91 | 91 | * published by: Sir-Tech |
102 | 102 | |
103 | 103 | ### Sabotage |
104 | 104 | |
105 |  | |
105 |  | |
106 | 106 | |
107 | 107 | * written by: Mark Allen |
108 | 108 | * published by: On-Line Systems |
120 | 120 | |
121 | 121 | ### Penny Arcade |
122 | 122 | |
123 |  | |
123 |  | |
124 | 124 | |
125 | 125 | * written by: Bill Budge |
126 | 126 | * published by: Apple Computer, Inc. |
142 | 142 | |
143 | 143 | ### Sammy Lightfoot |
144 | 144 | |
145 |  | |
145 |  | |
146 | 146 | |
147 | 147 | * written by: Warren Schwader |
148 | 148 | * published by: Sierra On-Line |
9 | 9 | |
10 | 10 | ### Haunted House |
11 | 11 | |
12 |  | |
12 |  | |
13 | 13 | |
14 | 14 | * written by: James Andreasen |
15 | 15 | * genre: Graphic Adventure |
22 | 22 | |
23 | 23 | ### Adventure |
24 | 24 | |
25 |  | |
25 |  | |
26 | 26 | |
27 | 27 | * written by: Warren Robinett |
28 | 28 | * genre: Graphic Adventure |
38 | 38 | |
39 | 39 | ### Yars' Revenge |
40 | 40 | |
41 |  | |
41 |  | |
42 | 42 | |
43 | 43 | * written by: Howard Scott Warshaw |
44 | 44 | * genre: Shoot-'em-Up |
9 | 9 | |
10 | 10 | ### Dynamite Dan |
11 | 11 | |
12 |  | |
12 |  | |
13 | 13 | |
14 | 14 | * written by: Rod Bowkett |
15 | 15 | * published by: Mirrorsoft |
31 | 31 | |
32 | 32 | ### Street Surfer |
33 | 33 | |
34 |  | |
34 |  | |
35 | 35 | |
36 | 36 | * written by: David Barbour |
37 | 37 | * published by: Mastertronic |
59 | 59 | |
60 | 60 | ### Pharaoh's Curse |
61 | 61 | |
62 |  | |
62 |  | |
63 | 63 | |
64 | 64 | * written by: Steve Coleman |
65 | 65 | * published by: Synapse Software |
85 | 85 | |
86 | 86 | ### Fire Ant |
87 | 87 | |
88 |  | |
88 |  | |
89 | 89 | |
90 | 90 | * written by: Unknown |
91 | 91 | * genre: Graphic Adventure(?) |
103 | 103 | |
104 | 104 | ### Necromancer |
105 | 105 | |
106 |  | |
106 |  | |
107 | 107 | |
108 | 108 | * written by: Bill Williams |
109 | 109 | * published by: Synapse Software |
125 | 125 | |
126 | 126 | ### Whistler's Brother |
127 | 127 | |
128 |  | |
128 |  | |
129 | 129 | |
130 | 130 | * written by: Louis Ewens |
131 | 131 | * published by: Brøderbund |
147 | 147 | |
148 | 148 | ### Zeppelin |
149 | 149 | |
150 |  | |
150 |  | |
151 | 151 | |
152 | 152 | * written by: William Mataga, David Barbour |
153 | 153 | * published by: Synapse Software |
177 | 177 | |
178 | 178 | ### Slinky |
179 | 179 | |
180 |  | |
180 |  | |
181 | 181 | |
182 | 182 | * written by: Unknown |
183 | 183 | * published by: Cosmi |
16 | 16 | |
17 | 17 | ### Rock Star Ate My Hamster |
18 | 18 | |
19 |  | |
19 |  | |
20 | 20 | |
21 | 21 | * authors: unknown |
22 | 22 | * published by: Codemasters |
32 | 32 | |
33 | 33 | ### The Prisoner |
34 | 34 | |
35 |  | |
35 |  | |
36 | 36 | |
37 | 37 | * authors: David Mullich |
38 | 38 | * published by: Edu-Ware |
75 | 75 | |
76 | 76 | ### Where in Hell is Carmen Santiago |
77 | 77 | |
78 |  | |
78 |  | |
79 | 79 | |
80 | 80 | * authors: St. John M. Morrison |
81 | 81 | * genre: Trivia |
14 | 14 | |
15 | 15 | ### Cool Boarders 2 |
16 | 16 | |
17 |  | |
17 |  | |
18 | 18 | |
19 | 19 | * written by: unknown |
20 | 20 | * genre: Sports |
31 | 31 | |
32 | 32 | ### Super Dodge Ball |
33 | 33 | |
34 |  | |
34 |  | |
35 | 35 | |
36 | 36 | * written by: unknown |
37 | 37 | * genre: Sports |
46 | 46 | |
47 | 47 | ### Sam & Ed Basketball |
48 | 48 | |
49 |  | |
49 |  | |
50 | 50 | |
51 | 51 | * written by: unknown |
52 | 52 | * published by: COMPUTE! Publications Inc. |
13 | 13 | |
14 | 14 | ### Alphaman |
15 | 15 | |
16 |  | |
16 |  | |
17 | 17 | |
18 | 18 | * written by: Jeff Olson |
19 | 19 | * available for: MS-DOS |
46 | 46 | |
47 | 47 | ### Mazes and Monsters |
48 | 48 | |
49 |  | |
49 |  | |
50 | 50 | |
51 | 51 | * date released: 1982 |
52 | 52 | * wikipedia: [Mazes and Monsters](https://en.wikipedia.org/wiki/Mazes_and_Monsters) |
61 | 61 | |
62 | 62 | ### The Spawn of Fashan |
63 | 63 | |
64 |  | |
64 |  | |
65 | 65 | |
66 | 66 | * written by: Kirby Lee Davis |
67 | 67 | * published by: The Games of Fashan |
75 | 75 | |
76 | 76 | ### Below the Root |
77 | 77 | |
78 |  | |
78 |  | |
79 | 79 | |
80 | 80 | * published by: Windham Classics |
81 | 81 | * available for: Commodore 64, Apple II, MS-DOS |
100 | 100 | |
101 | 101 | ### Galactic Gladiators |
102 | 102 | |
103 |  | |
103 |  | |
104 | 104 | |
105 | 105 | * written by: Tom Reamy |
106 | 106 | * published by: Strategic Simulations, Inc. |
120 | 120 | |
121 | 121 | ### Wonder Boy in Monster Land |
122 | 122 | |
123 |  | |
123 |  | |
124 | 124 | |
125 | 125 | * written by: Ryuichi Nishizawa |
126 | 126 | * published by: Sega |
142 | 142 | |
143 | 143 | ### Adventure Construction Set |
144 | 144 | |
145 |  | |
145 |  | |
146 | 146 | |
147 | 147 | * available for: Commodore 64, others |
148 | 148 | * controls: joystick and one button |
166 | 166 | |
167 | 167 | ### Sword of Fargoal |
168 | 168 | |
169 |  | |
169 |  | |
170 | 170 | |
171 | 171 | * written by: Jeff McCord |
172 | 172 | * published by: Epyx |
182 | 182 | |
183 | 183 | ### Dungeon Master |
184 | 184 | |
185 |  | |
185 |  | |
186 | 186 | |
187 | 187 | * published by: FTL Games |
188 | 188 | * available for: Atari ST, Amiga |
16 | 16 | |
17 | 17 | ### Racked Off |
18 | 18 | |
19 |  | |
19 |  | |
20 | 20 | |
21 | 21 | * written by: Richard Bayliss |
22 | 22 | * genre: Collect-the-Dots |
31 | 31 | |
32 | 32 | ### Joe Gunn |
33 | 33 | |
34 |  | |
34 |  | |
35 | 35 | |
36 | 36 | * written by: Georg Rottensteiner, Paul Pridham, Howard Kistler, Thomas Egeskov Petersen |
37 | 37 | * genre: Graphic Adventure |
50 | 50 | |
51 | 51 | ### Fairy Well |
52 | 52 | |
53 |  | |
53 |  | |
54 | 54 | |
55 | 55 | * written by: Mix256, TDM of Triad |
56 | 56 | * genre: Graphic Adventure? |
64 | 64 | |
65 | 65 | ### Fall Down |
66 | 66 | |
67 |  | |
67 |  | |
68 | 68 | |
69 | 69 | * written by: Aaron Curtis |
70 | 70 | * genre: Platformer? |
24 | 24 | |
25 | 25 | ### African Adventure: In Search of Dr. Livingston |
26 | 26 | |
27 |  | |
27 |  | |
28 | 28 | |
29 | 29 | * written by: R. Fullerton, B. Fullerton, C. Russell, K. Russell |
30 | 30 | * available for: Commodore PET, Commodore 64, PC-DOS |
56 | 56 | |
57 | 57 | ### Cranston Manor |
58 | 58 | |
59 |  | |
59 |  | |
60 | 60 | |
61 | 61 | * written by: Ken Williams, Harold DeWitz |
62 | 62 | * published by: On-Line Systems |
76 | 76 | |
77 | 77 | ### Creature Venture |
78 | 78 | |
79 |  | |
79 |  | |
80 | 80 | |
81 | 81 | * written by: Highlands Computer Services |
82 | 82 | * published by: Highlands Computer Services |
96 | 96 | |
97 | 97 | ### Time and Magik (Trilogy) |
98 | 98 | |
99 |  | |
99 |  | |
100 | 100 | |
101 | 101 | * written by: Sue Gazzard, others, Level 9 |
102 | 102 | * published by: Mandarin |
140 | 140 | |
141 | 141 | ### Winter Wonderland |
142 | 142 | |
143 |  | |
143 |  | |
144 | 144 | |
145 | 145 | * written by: Tim Walsha, Simon Lipscomb |
146 | 146 | * published by: Incentive Software |
170 | 170 | |
171 | 171 | ### The Secret of St. Bride's |
172 | 172 | |
173 |  | |
173 |  | |
174 | 174 | |
175 | 175 | * written by: Priscilla Langridge |
176 | 176 | * published by: St. Bride's School |
26 | 26 | |
27 | 27 | ### Typhoon Thompson |
28 | 28 | |
29 |  | |
29 |  | |
30 | 30 | |
31 | 31 | * written by: Dan Gorlin |
32 | 32 | * published by: Brøderbund |
51 | 51 | |
52 | 52 | ### Pepper II |
53 | 53 | |
54 |  | |
54 |  | |
55 | 55 | |
56 | 56 | * published by: Exidy |
57 | 57 | * genre: Maze-Runner |
68 | 68 | |
69 | 69 | ### City Connection |
70 | 70 | |
71 |  | |
71 |  | |
72 | 72 | |
73 | 73 | * published by: Jaleco |
74 | 74 | * genre: Platformer (nominally) |
86 | 86 | |
87 | 87 | ### Lost Tomb |
88 | 88 | |
89 |  | |
89 |  | |
90 | 90 | |
91 | 91 | * genre: Shoot-'em'-Up |
92 | 92 | * available for: Arcade |
107 | 107 | |
108 | 108 | ### Looping |
109 | 109 | |
110 |  | |
110 |  | |
111 | 111 | |
112 | 112 | * published by: Venture Line |
113 | 113 | * genre: Maze-runner |
132 | 132 | |
133 | 133 | ### Liquid Kids |
134 | 134 | |
135 |  | |
135 |  | |
136 | 136 | |
137 | 137 | * published by: Taito |
138 | 138 | * genre: Platformer |
149 | 149 | |
150 | 150 | ### The New Zealand Story |
151 | 151 | |
152 |  | |
152 |  | |
153 | 153 | |
154 | 154 | * published by: Taito |
155 | 155 | * genre: Platformer |
165 | 165 | |
166 | 166 | ### Llamatron |
167 | 167 | |
168 |  | |
168 |  | |
169 | 169 | |
170 | 170 | * written by: Jeff Minter |
171 | 171 | * genre: Shoot-'em'-Up |
2 | 2 | # Invoke like the following, rewrites the file in-place: |
3 | 3 | # PYTHONPATH=../Feedmark/src ./script/rewrite-images.py article/Some\ Modern\ Retrogames.md |
4 | 4 | |
5 | from argparse import ArgumentParser | |
5 | 6 | import json |
6 | 7 | import sys |
7 | ||
8 | from argparse import ArgumentParser | |
8 | try: | |
9 | from urllib import unquote, quote_plus | |
10 | except ImportError: | |
11 | from urllib.parse import unquote, quote_plus | |
12 | assert unquote and quote_plus | |
9 | 13 | |
10 | 14 | from feedmark.checkers import Schema |
11 | 15 | from feedmark.loader import read_document_from |
12 | 16 | from feedmark.formats.markdown import feedmark_markdownize |
17 | ||
18 | ||
19 | def url_to_dirname_and_filename(url): | |
20 | """Lifted from yastasoti: https://catseye.tc/node/yastasoti """ | |
21 | parts = url.split(u'/') | |
22 | parts = parts[2:] | |
23 | domain_name = parts[0] | |
24 | domain_name = quote_plus(domain_name) | |
25 | parts = parts[1:] | |
26 | filename = u'/'.join(parts) | |
27 | filename = quote_plus(filename.encode('utf-8')) | |
28 | if not filename: | |
29 | filename = 'index.html' | |
30 | return (domain_name, filename) | |
13 | 31 | |
14 | 32 | |
15 | 33 | def main(args): |
37 | 55 | for section in document.sections: |
38 | 56 | new_images = [] |
39 | 57 | for alt_text, url in section.images: |
40 | rewritten_url = url | |
58 | if url.startswith(('http://catseye.tc', 'https://catseye.tc', 'http://static.catseye.tc', 'https://static.catseye.tc',)): | |
59 | rewritten_url = url | |
60 | else: | |
61 | dirname, filename = url_to_dirname_and_filename(url) | |
62 | rewritten_url = 'https://static.catseye.tc/archive/{}/{}'.format(dirname, quote_plus(filename)) | |
41 | 63 | new_images.append((alt_text, rewritten_url)) |
42 | 64 | section.images = new_images |
43 | 65 | s = feedmark_markdownize(document, schema=schema) |
47 | 69 | |
48 | 70 | if __name__ == '__main__': |
49 | 71 | main(sys.argv[1:]) |
50 | ||
51 |