Difference between revisions of "Transcript"
m |
|||
(21 intermediate revisions by 12 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Most [[xkcd]] comics have a transcript posted on xkcd. This info covers details like the comics title, the date and link to the image and the [[Title text|title text]]. The [https://www.xkcd.com/about/ xkcd about page] says: | |
− | Most [[xkcd]] comics have a transcript posted on xkcd | ||
− | |||
− | |||
− | |||
− | |||
− | The | ||
− | |||
− | + | {{Quote|Is there an interface for automated systems to access comics and metadata? | |
+ | :''Yes. You can get comics through the JSON interface, at URLs like https://xkcd.com/info.0.json (current comic) and https://xkcd.com/614/info.0.json (comic #614).|[[Randall Munroe]]|[https://www.xkcd.com/about/ about xkcd]}} | ||
+ | The official transcript is different from the ones on Explain xkcd, which are more detailed and descriptive. Randall occasionally cites Explain xkcd for the transcript, like for the comic [[1461: Payloads]]. You can find more information in the [[1461: Payloads#Trivia|comic's trivia section]]. | ||
− | + | ==End of transcripts== | |
+ | Using the mentioned method, the last available transcript on xkcd for [[1608: Hoverboard]] can be found at https://xkcd.com/1608/info.0.json. However, an error occurred during the combination of transcripts with other details. The subsequent two comics after Hoverboard do not have transcripts, only the accompanying details such as title, date, and title text. Then, the transcripts resumed, but for the comic released two numbers prior. Therefore, the transcript for [[1609: Food Combinations]], which should have been on https://xkcd.com/1609/info.0.json, was instead "released" on https://xkcd.com/1611/info.0.json, where the transcript for [[1611: Baking Soda and Vinegar]] should have been. The pattern continued, and the last comic with a transcript is [[1674: Adult]], with the transcript for that comic found three comics later under [[1677: Contrails]] on https://xkcd.com/1677/info.0.json. After [[1674: Adult]], no more transcripts have been provided. | ||
− | + | This python script (public domain) can be used to quickly verify if and where new transcripts have been added: | |
− | + | <pre>#!/usr/bin/env python3 | |
import requests | import requests | ||
import sys | import sys | ||
Line 22: | Line 18: | ||
latest = requests.get(url='https://xkcd.com/info.0.json').json()['num'] | latest = requests.get(url='https://xkcd.com/info.0.json').json()['num'] | ||
− | + | new_transcripts = False | |
− | for i in range (latest, last_known_transcript, -1): | + | for i in range(latest, last_known_transcript, -1): |
− | sys.stderr.write ('.') | + | sys.stderr.write('.') |
sys.stderr.flush() | sys.stderr.flush() | ||
− | if | + | if requests.get(url='https://xkcd.com/'+str(i)+'/info.0.json').json()['transcript'] != '': |
− | print ("\n", i, "has a transcript") | + | print("\n", i, "has a transcript") |
− | + | new_transcripts = True | |
− | print ( | + | print() |
− | if | + | if not new_transcripts: |
− | print ("no new transcripts have been added") | + | print("no new transcripts have been added")</pre> |
− | </ | + | |
− | + | [[Category:Design of xkcd.com]] | |
− | [[Category:Design of xkcd]] | + | {{xkcdmeta}} |
Latest revision as of 10:04, 24 July 2023
Most xkcd comics have a transcript posted on xkcd. This info covers details like the comics title, the date and link to the image and the title text. The xkcd about page says:
Is there an interface for automated systems to access comics and metadata?
- Yes. You can get comics through the JSON interface, at URLs like https://xkcd.com/info.0.json (current comic) and https://xkcd.com/614/info.0.json (comic #614).
The official transcript is different from the ones on Explain xkcd, which are more detailed and descriptive. Randall occasionally cites Explain xkcd for the transcript, like for the comic 1461: Payloads. You can find more information in the comic's trivia section.
End of transcripts[edit]
Using the mentioned method, the last available transcript on xkcd for 1608: Hoverboard can be found at https://xkcd.com/1608/info.0.json. However, an error occurred during the combination of transcripts with other details. The subsequent two comics after Hoverboard do not have transcripts, only the accompanying details such as title, date, and title text. Then, the transcripts resumed, but for the comic released two numbers prior. Therefore, the transcript for 1609: Food Combinations, which should have been on https://xkcd.com/1609/info.0.json, was instead "released" on https://xkcd.com/1611/info.0.json, where the transcript for 1611: Baking Soda and Vinegar should have been. The pattern continued, and the last comic with a transcript is 1674: Adult, with the transcript for that comic found three comics later under 1677: Contrails on https://xkcd.com/1677/info.0.json. After 1674: Adult, no more transcripts have been provided.
This python script (public domain) can be used to quickly verify if and where new transcripts have been added:
#!/usr/bin/env python3 import requests import sys last_known_transcript = 1677 latest = requests.get(url='https://xkcd.com/info.0.json').json()['num'] new_transcripts = False for i in range(latest, last_known_transcript, -1): sys.stderr.write('.') sys.stderr.flush() if requests.get(url='https://xkcd.com/'+str(i)+'/info.0.json').json()['transcript'] != '': print("\n", i, "has a transcript") new_transcripts = True print() if not new_transcripts: print("no new transcripts have been added")