A hacky experiment in semi-automatically creating a Wikipedia list article using data from Wikidata, and Wikipedia categories. Target first article is "List of gay novels prior to the Stonewall riots".
scrape_gay_novel_data.py
grabs all pages in Wikipedia's "Novels with gay themes" category, and fetches the corresponding Wikidata item. Writes results tonoveldat.json
.write_listicle.py
generates a file containing wikitext table populated with data fromnoveldat.json
prematter.wiki
and postmatter.wiki
contain hand-written wikitext to precede and follow the generated table. The final article is the result of catting them with the table generated by write_listicle.py
sandwiched in the middle.