More fun with the monkey
17th September 2005
Cory Doctorow points to America from the Great Depression to World War II: Color Photographs from the FSA-OWI, 1939-1945, with the following observation:
Unfortunately, the organizational back-end for this is so primitive (especially in comparison with modern image-sharing and organizing sites like Flickr) that it, too, seems to hail from 1939-1945, making the site a real pain to navigate and use.
Thanks to Greasemonkey, great content spoiled by poor navigation is a solvable problem.
americanmemoryfixer.user.js includes the following improvements:
- Changes the colour scheme to black-on-white, and the typeface to Verdana.
- Removes all table borders.
- Adds headings to some pages, and fixes various title tags.
- Sets the default gallery view to be a set of thumbnails, rather than a list of names.
- Displays a large image (as opposed to a thumbnail) when you view a photograph.
The scariest hack in the script is the way in which subject page titles are passed around. In the current site, if you visit a category page (such as Sharecroppers) the title of the category is not displayed on the page—even though it has been passed as a parameter in the URL. If you click a link (say to the Galley thumbnail page) the information in the URL is lost as well.
My solution was to extract the subject from the URL on that first page, then rewrite the other links to include an additional “&subject=Sharecroppers” parameter. This new parameter is ignored by the CGI scripts that power the site, but my Greasemonkey script watches out for it on subsequent pages and uses it to display a title (and further propagate it to other links on the page). It’s not a very robust solution, but it’s good enough.
There’s plenty of scope for further improvement—if you want to use my script as a starting point, please feel free.
More recent articles
- Weeknotes: a Datasette release, an LLM release and a bunch of new plugins - 9th February 2024
- LLM 0.13: The annotated release notes - 26th January 2024
- Weeknotes: datasette-test, datasette-build, PSF board retreat - 21st January 2024
- Talking about Open Source LLMs on Oxide and Friends - 17th January 2024
- Publish Python packages to PyPI with a python-lib cookiecutter template and GitHub Actions - 16th January 2024
- What I should have said about the term Artificial Intelligence - 9th January 2024
- Weeknotes: Page caching and custom templates for Datasette Cloud - 7th January 2024
- It's OK to call it Artificial Intelligence - 7th January 2024
- Tom Scott, and the formidable power of escalating streaks - 2nd January 2024