Last active
January 2, 2016 15:49
-
-
Save commuterjoy/8325989 to your computer and use it in GitHub Desktop.
benchmark next-gen from r2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Next-gen performance benchmark - https://gist.github.com/commuterjoy/8325989 | |
jQ(document).ready(function () { | |
if ( s | |
&& (s.prop67 === "nextgen-compatible") | |
) { | |
jQ.get(location.pathname + '?view=mobile'); | |
try { | |
var nextGenNavigation = 'http://api.nextgen.guardianapps.co.uk'; | |
var edition = guardian.page.edition.toLowerCase(); | |
var section = guardian.page.contentId.split("/")[1]; | |
var path = location.pathname; | |
jQ.get(nextGenNavigation + '/top-stories/trails.json?page-size=10&view=link&_edition='+edition); | |
// Stop us requesting 'most-read' sections that don't exist | |
if (/profile|tone|undefined|global|identity|most-read/.test(section)) { | |
return; | |
} | |
jQ.get(nextGenNavigation + '/most-read/'+section+'.json?_edition='+edition); | |
} catch(e) { | |
console.log('next-gen-performance-benchmark', e); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment