National Independence day.

Log in to Vote
4 Votes • 5 Comments
DDG could tell the national independence day around the world when the user search for "Independence day of Turkey", or even "July 4".
• posted 4 years and 4 months ago In Development

I am intrested in doing this. Can anyone guide me throug this?
posted by arajparaj 4 years and 4 months ago Link
I was interested in this too, I wrote a perl script to pull the data out of the html table from that wikipedia article.

I have not yet written an instant answer plugin myself, so I' might not the best person to function as a guide. But I'd love to work on the data source, if you want to implement the actual goodie (since I didn't start myself).

I made a new branch for this on my github

Look in the /share/goodie/independece_day directory if you want. There is a copy of the html table from wikipedia and a perl script that converts it into json. It needs some work still, but it's a start. I'm not sure what the preferred way to store data in text files is for goodies, but i went with json.

I also added test file (/t/IndependenceDay.t) and the actual goodie script (/lib/DDG/Goodie/ Those two are just copies of the template ones, I have't actually touched them.

posted by dufa 4 years and 4 months ago Link
I went ahead and implementd this. There is an open pull request for it on gihub:
posted by dufa 4 years and 3 months ago Link
Implementation ready for review:

@arajparaj I've used your JSON datasource (credit in source code of course) - thanks. I had to adjust it a little bit:
* July 21 -> July 21st
* "Korea, South" -> "South Korea"
* Some countries have 2 dates. Sometimes, both are in the same JSON entry, sometimes there are two entries

Depending on how the review goes, it would be nice to have a wikipedia parser that generates the exact JSON with no need for manual adjustments.

Anyway the feature is still crude IMO, so there's room for further enhancements.
posted by youri 4 years and 3 months ago Link
Great, so two people worked on the same idea at the same time... :-/
posted by youri 4 years and 3 months ago Link