Skip to content

Instantly share code, notes, and snippets.

@ChristopherSalam
Created September 11, 2015 09:47
Show Gist options
  • Save ChristopherSalam/58ff752d3ff11c49f6e5 to your computer and use it in GitHub Desktop.
Save ChristopherSalam/58ff752d3ff11c49f6e5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Christopher Salam – thoughts on software and engineering</title>
<meta charset="utf-8" />
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.js"></script>
<div id="pic"></div>
<script>
var ballerWiki = "http://en.wikipedia.org/w/api.php?action=mobileview&format=json&page=Michael%20Jordan&redirect=no&sections=0&prop=text&sectionprop=toclevel%7Clevel%7Cline%7Cnumber%7Cindex%7Cfromtitle%7Canchor&callback=?"
$.getJSON(ballerWiki, function(json) {
var wikitext = json.mobileview.sections[0].text;
$('#pic').hide().append(wikitext);
var img = $('#pic').find('.infobox img:first').attr('src');
$('#pic').show().html('<img style="height: 150px; border-radius:75px" src="' + img + '"/>');
}
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment