Skip to content

Instantly share code, notes, and snippets.

@jfahrenkrug
Created June 7, 2017 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfahrenkrug/22b5cad4553790089a659b61aa41231a to your computer and use it in GitHub Desktop.
Save jfahrenkrug/22b5cad4553790089a659b61aa41231a to your computer and use it in GitHub Desktop.
Extract the WWDC 2017 Sample Code URL from the sessions page. Just paste it into the JS console on https://developer.apple.com/wwdc/schedule/
$.getJSON( "https://devimages-cdn.apple.com/wwdc-services/h8a19f8f/049CCC2F-0D8A-4F7D-BAB9-2D8F5BAA7030/contents.json", function( data ) {
var items = [];
$.each( data.contents, function( key, val ) {
if (val.type == 'Session' && val.eventId == 'wwdc2017' && val.related && val.related.resources) {
$.each(val.related.resources, function (resKey, resId) {
var resource = data.resources[resId]
if (resource && resource['resource_type'] == 'samplecode') {
items.push(resource);
}
});
}
});
console.log(items);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment