Skip to content

Commit 9ebceb3

Browse files
author
Andrius Zidonis
committed
#48 - fix google api url
1 parent 91676c8 commit 9ebceb3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
/npm-debug.log
33
devperf
44
perf-tool
5+
.idea/

gulpfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ gulp.task('watch', function() {
6767

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

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

0 commit comments

Comments
 (0)