Skip to content

Instantly share code, notes, and snippets.

@edsu
edsu / pizza.txt
Last active February 3, 2018 21:31
An example of looking up Pizza in Wikidata, to see the equivalent entities on other Wikipedias using the wggetentities call in the Wikidata API http://wikidata.org/w/api.php. The use of python as a filter on the end of curl is just to pretty print the JSON. You can obviously leave it off if you don't have Python available. In response to https:/…
curl "https://www.wikidata.org/w/api.php?action=wbgetentities&sites=itwiki&titles=Pizza&format=json" | python -mjson.tool
{
"entities": {
"q177": {
"descriptions": {
"de": {
"language": "de",
"value": "Gericht"
},
"en": {
@stammy
stammy / wordpress_importer.rb
Last active March 27, 2022 09:39
Import a WordPress database and generate markdown files for Jekyll
# View my Jekyll blog http://paulstamatiou.com and my jekyll migration post http://paulstamatiou.com/how-to-wordpress-to-jekyll/
#
#
# based on the import script by icebreaker, which is based on mojombo's
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# https://gist.github.com/303570
# edited to rewrite image URLs to use my CloudFront URL
require 'rubygems'
require 'sequel'