Latest update: 16 September 2024
This page gives more info about
What are the main files and folders in this repo, and what do they do?
category_logo_dict.json category_logo_dict_nde.json
README.md - this file
GLAMorous_MediacontributedbyKoninklijkeBibliotheek_Wikipedia_Mainnamespace_10012024.html
To follow.. <!–If you want to run this script for your own Commons category and create HTML and Excel overviews for your own institution, you can clone/download the repo and run it on your own machine. You will need to make some simple adaptations to the existing code to make it work for the Commons category of your choice. These are:
3) In setup.py, change
That’s all, you should now be able to run the main GLAMorousToHTML script. The generated HTML page will be added to the site/ folder and the Excel to the data/ folder.
In case you can’t get the script up and running, please open an issue in this repo.
The script relies on the XML output of the GLAMorous tool, which needs to be configured so that it only lists pages from Wikipedia
1) that are in the main namespace (a.k.a Wikipedia articles) (&ns0=1)
2) and not pages from Wikimedia Commons, Wikidata or other Wikimedia projects (projects[wikipedia]=1)
The base URL thus looks like https://glamtools.toolforge.org/glamorous.php?doit=1&use_globalusage=1&ns0=1&projects[wikipedia]=1&format=xml&category=. The Commons category of interest needs to be added to the end, omitting the Category: prefix. This base URL is defined (and can be adapted if necessary) in the xml_base_url variable in GLAMorousToHTML_functions.process_category.
The depth of the GLAMorous output (where ‘0’ means no subcategories are read) is specified in the depth (=fourth) variable in category_logo_dict.json. See the section on Repo structure below for more info.
1) Adapt the category_logo_dict.json for your own needs, making sure the existing syntax is maintained.
Under this country key, add a line with a syntax identical to the one starting with “Media contributed by Koninklijke Bibliotheek”, but with modifications for four things:
1) The exact name (without underscores ‘_’) of the Wikimedia Commons category you want run the script for (“Media contributed by Koninklijke Bibliotheek”)
2) A shortname of the institution (“KoninklijkeBibliotheekNL”). This is used for the name of the sheet in the Excel file, so keep it shorter than 32 characters.
3) Name of an institutional logo file, starting with “icon_”, followed by a unique and descriptive letter code for the institution, and appended with a .png or .jpg extension at the end. This logo/icon is displayed at the top of the HTML page. Don’t forget the next step!
4) The GLAMororous ‘Search depth’ parameter. Default = ‘0’, for no subcategories. For Category:Collections of Leiden University Library depth = 5, so all files up to 5 subcategories deep are also taken into account.
2) Add a small logo of the institution (256x256 px or so) as a .png of .jpg to the site/logos folder, and add the filename “icon_xxxxx.png/jpg” to the json file.
–>