Skip to content

Instantly share code, notes, and snippets.

@rkravchik
Created September 27, 2017 09:30
Show Gist options
  • Save rkravchik/53ace3a82ee24c9cb18557565a262927 to your computer and use it in GitHub Desktop.
Save rkravchik/53ace3a82ee24c9cb18557565a262927 to your computer and use it in GitHub Desktop.
vkscript photo max size uri. <photoID> - photo ID in format "ownerid_id_accesskey".
var r = API.photos.getById({photos: <photoID>});
if (r[0] == null) {return {uri: null};}
var p = r[0];
if (p.photo_2560 != null){return {uri: p.photo_2560};}
if (p.photo_1280 != null){return {uri: p.photo_1280};}
if (p.photo_807 != null){return {uri: p.photo_807};}
if (p.photo_604 != null){return {uri: p.photo_604};}
if (p.photo_130 != null){return {uri: p.photo_130};}
if (p.photo_75 != null){return {uri: p.photo_75};}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment