gockelhahn / qual-o-mat-data

JSON data from Wahl-O-Mat
56 stars 9 forks source link

Add slug to election overview.json? #3

Closed oyooyo closed 3 years ago

oyooyo commented 4 years ago

Hi, what about adding a "slug" property to the overview.json of elections? By "slug", I mean the ID of the election in the official wahl-o-mat URLs. For example, the base URL of the Europawahl 2019 election was: https://www.wahl-o-mat.de/europawahl2019/ and in this case, what I call the "slug" of that election would be "europawahl2019".

overview.json already contains the "data_source" property, which in this case would be "https://www.wahl-o-mat.de/europawahl2019/PositionsvergleichEuropawahl2019.pdf", so I guess it's not a big deal to extract the slug from the data_source property. But I think it would be nice to have the slug pre-extracted as an additional property in overview.json.

gockelhahn commented 3 years ago

@oyooyo please have a look if you like it ... i am not sure if it makes any sense, since a lot old wahl-o-mats are not available anymore!

oyooyo commented 3 years ago

@gockelhahn Looks perfect to me. Thanks!

I agree that it doesn't make much sense for old/outdated elections. This was actually only meant as a suggestion for future elections, I didn't consider that you'd have to change the old election data as well for consistency. Sorry for causing you that additional work...

I just realized that I originally forgot to mention the rationale behind the suggestion: The idea was that alternatives to the original Wahl-o-mat could easily make the slug a part of their URL as well. So that, for example, if one wanted to recommend a a Wahl-o-mat-alternative to someone who has only used the original Wahl-o-mat so far, one could say something like

"Just replace wahl-o-mat in the URL with wahl-o-wahl! For example, instead of https://wahl-o-mat.de/bundestagswahl2021/, visit the URL https://wahl-o-wahl.de/bundestagswahl2021/"