Support getting artist bios from Wikipedia (experimental)

This commit is contained in:
Claudio Ortolina
2026-02-09 15:19:35 +00:00
parent f82e764c94
commit bcae291cff
23 changed files with 639 additions and 31 deletions
@@ -0,0 +1,13 @@
{
"batchcomplete": "",
"query": {
"pages": {
"1845781": {
"pageid": 1845781,
"ns": 0,
"title": "Steven Wilson",
"extract": "<p><b>Steven John Wilson</b> (born 3 November 1967) is an English musician. He is most associated with the progressive rock genre, though his influences and work extend beyond it. Wilson first became known as the founder, lead guitarist, singer, and songwriter of the band Porcupine Tree, as well as being a member of several other bands.</p>\n<p>Wilson has been involved in musical projects including No-Man, Bass Communion, Blackfield, and Storm Corrosion. He has also worked as a record producer and is known for his surround sound and high-fidelity stereo remixes of classic albums by artists such as King Crimson, Jethro Tull, Tears for Fears, Roxy Music, and Yes.</p>\n<p>His solo career began in earnest in 2008. He has released six solo studio albums, including <i>The Raven That Refused to Sing (And Other Stories)</i> (2013) and <i>Hand. Cannot. Erase.</i> (2015), both of which received critical acclaim. His seventh album, <i>The Overview</i>, was released in 2025.</p>"
}
}
}
}
@@ -0,0 +1,35 @@
{
"type": "standard",
"title": "Steven Wilson",
"displaytitle": "Steven Wilson",
"namespace": {
"id": 0,
"text": ""
},
"wikibase_item": "Q352766",
"titles": {
"canonical": "Steven_Wilson",
"normalized": "Steven Wilson",
"display": "Steven Wilson"
},
"pageid": 1845781,
"extract": "Steven John Wilson is an English musician. He is most associated with the progressive rock genre, though his influences and work extend beyond it.",
"extract_html": "<p><b>Steven John Wilson</b> is an English musician. He is most associated with the progressive rock genre, though his influences and work extend beyond it.</p>",
"description": "English musician and record producer",
"content_urls": {
"desktop": {
"page": "https://en.wikipedia.org/wiki/Steven_Wilson",
"revisions": "https://en.wikipedia.org/wiki/Steven_Wilson?action=history",
"edit": "https://en.wikipedia.org/wiki/Steven_Wilson?action=edit",
"talk": "https://en.wikipedia.org/wiki/Talk:Steven_Wilson"
},
"mobile": {
"page": "https://en.m.wikipedia.org/wiki/Steven_Wilson",
"revisions": "https://en.m.wikipedia.org/w/index.php?title=Steven_Wilson&action=history",
"edit": "https://en.m.wikipedia.org/w/index.php?title=Steven_Wilson&action=edit",
"talk": "https://en.m.wikipedia.org/wiki/Talk:Steven_Wilson"
}
},
"lang": "en",
"dir": "ltr"
}
@@ -0,0 +1,35 @@
defmodule Wikipedia.Fixtures do
@fixtures_folder Path.join([File.cwd!(), "test/support/fixtures/wikipedia"])
def wikidata_response do
Path.join([@fixtures_folder, "wikidata_response.json"])
|> File.read!()
|> JSON.decode!()
end
def wikidata_response_no_enwiki do
Path.join([@fixtures_folder, "wikidata_response_no_enwiki.json"])
|> File.read!()
|> JSON.decode!()
end
def article_summary do
Path.join([@fixtures_folder, "article_summary.json"])
|> File.read!()
|> JSON.decode!()
end
def article_extract do
Path.join([@fixtures_folder, "article_extract.json"])
|> File.read!()
|> JSON.decode!()
end
def article_extract_html do
article_extract()
|> get_in(["query", "pages"])
|> Map.values()
|> List.first()
|> Map.get("extract")
end
end
@@ -0,0 +1,16 @@
{
"entities": {
"Q352766": {
"type": "item",
"id": "Q352766",
"sitelinks": {
"enwiki": {
"site": "enwiki",
"title": "Steven Wilson",
"badges": []
}
}
}
},
"success": 1
}
@@ -0,0 +1,10 @@
{
"entities": {
"Q999999": {
"type": "item",
"id": "Q999999",
"sitelinks": {}
}
},
"success": 1
}