You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
3.1 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Ursula Franklin"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![](https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Ursula_Franklin_at_book_launch_crop.jpg/220px-Ursula_Franklin_at_book_launch_crop.jpg)\n",
"\n",
"You can find the recordings of her Massey lectures on [archive.org](https://archive.org/details/the-real-world-of-technology). Note the URL: \n",
"\n",
"<https://archive.org/details/the-real-world-of-technology>\n",
"\n",
"You can also access the API of archive.org to get information in a [structured format](https://archive.org/help/json.php) that you can use in a script...\n",
"\n",
"<https://archive.org/details/the-real-world-of-technology&output=json"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {},
"outputs": [],
"source": [
"identifier = \"the-real-world-of-technology\"\n",
"url = f\"https://archive.org/details/{identifier}\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from urllib.request import urlopen\n",
"import json"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"f = urlopen(url+\"&output=json\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"feed = json.load(f)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"feed"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"len(feed['files'])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"According to the [Archive.org API](https://archive.org/services/docs/api/items.html#archival-urls):\n",
"\n",
"> A particular file can always be downloaded from:\n",
">```\n",
"> https://archive.org/download/<identifier>/<filename>\n",
">```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# this is something specific to notebooks...\n",
"from IPython.display import HTML, display"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for filename, d in feed['files'].items():\n",
" if d['format'] == \"VBR MP3\":\n",
" display(HTML(f'<h2>{d[\"title\"]}</h2>'))\n",
" display(HTML(f'<audio src=\"https://archive.org/download/{identifier}{filename}\" controls></audio>'))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}