I am trying to pull JSON data from Google+ API. When I include the image attribute size of the image is set to 50px. How do I change the image size? I don\'t see it on the
Just have to change the sz suffix indicating the wnated size, here is the suffix:
https://lh3.googleusercontent.com/-U353P5vNuRE/AAAAAAAAAAI/AAAAAAAABKM/a7U7bq251x0/photo.jpg?sz=150
If you cut the param, you would get the default photo sized
https://lh3.googleusercontent.com/-U353P5vNuRE/AAAAAAAAAAI/AAAAAAAABKM/a7U7bq251x0/photo.jpg
And an automatic change in the string: https://jsfiddle.net/upyL4onm/3/
var newSize="300"
var str = "https://lh3.googleusercontent.com/-U353P5vNuRE/AAAAAAAAAAI/AAAAAAAABKM/a7U7bq251x0/photo.jpg?sz=50";
var res = str.split("?sz=50")[0]+"?sz="+newSize;
And the console.log(res) will output:
https://lh3.googleusercontent.com/-U353P5vNuRE/AAAAAAAAAAI/AAAAAAAABKM/a7U7bq251x0/photo.jpg?sz=300