{"size": 593, "ext": "js", "max_stars_repo_path": "javascript/misc/random_euler.js", "max_stars_repo_name": "jechasteen/templates", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "javascript/misc/random_euler.js", "max_issues_repo_name": "jechasteen/templates", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "javascript/misc/random_euler.js", "max_forks_repo_name": "jechasteen/templates", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.65, "max_line_length": 70, "alphanum_fraction": 0.568296796}
// To use, go to https://projecteuler.net/archives
// then open the developer console and paste the contents of this file
// This will automatically direct to a random problem.

function getTotalProbs(){
  var p = document.querySelector( "p" ).textContent;
  var total = "";
  for ( var i = 0; i < p.length; i++ ) {
    if ( p[i] === "1" ){
      for ( var j = i + 5; p[j] != "."; j++ ) {
        total += p[j];
      }
      return Number( total );
    }
  }
}

window.location.href = "https://projecteuler.net/problem="
                      + Math.floor( Math.random() * getTotalProbs() );
