Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#48 - fix google api url
  • Loading branch information
Andrius Zidonis committed Jul 20, 2016
1 parent 91676c8 commit 9ebceb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@ node_modules
/npm-debug.log
devperf
perf-tool
.idea/
4 changes: 2 additions & 2 deletions gulpfile.js
Expand Up @@ -67,7 +67,7 @@ gulp.task('watch', function() {

function speedtest() {
console.log('(Google page speed) Job started.');
var googleAPIURL = 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed?filter_third_party_resources=false&locale=en_GB&screenshot=false&strategy={selected_strategy}&url=',
var googleAPIURL = 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed?filter_third_party_resources=false&locale=en_GB&screenshot=false&strategy={selected_strategy}',
strategies = ['desktop', 'mobile'],

results = { oldresults: { mobile: null, desktop: null }, newresults: {} },
Expand All @@ -92,7 +92,7 @@ function speedtest() {
function (currentValue, index, array) {
var selectedStrategy = strategies[strategy];
setTimeout(function(){
var url = googleAPIURL.replace('{selected_strategy}', selectedStrategy) + encodeURIComponent(currentValue);
var url = googleAPIURL.replace('{selected_strategy}', selectedStrategy) + '&url=' + encodeURIComponent(currentValue);
var response = httpGet(url);
if (response.status == 200) {
var pageSpeedResults = JSON.parse(response.responseText);
Expand Down

0 comments on commit 9ebceb3

Please sign in to comment.