Skip to content

Instantly share code, notes, and snippets.

@kopiro
Last active October 14, 2015 00:48
Show Gist options
  • Save kopiro/4281641 to your computer and use it in GitHub Desktop.
Save kopiro/4281641 to your computer and use it in GitHub Desktop.
try {
(function(){
if (!window.PhotoPermalink) throw "Photo not found on the page.";
var photoInf = PhotoPermalink.getInstance().getCurrentPhotoInfo();
if (!photoInf) throw "Photo not found on the page.";
var jsonList = prompt("Enter your JSON Friends List:\nYou can generate it on: http://kopiro.it/apps/jsonfs", "");
JSONFriends = JSON.parse(jsonList);
JSONFriends.map(function(usr)
{
if (!usr) return;
var x = Math.random()*100;
var y = Math.random()*100;
var p = Math.floor(Math.random());
var r = new AsyncRequest().setURI("/ajax/photo_tagging_ajax.php").setData({
cs_ver:0,
pid:photoInf.pid,
id:photoInf.owner,
subject:usr.id,
name:usr.name,
action:'add',
x:x,
y:y,
souce: 'permalink',
position: p
}).send();
});
}());
} catch (ex) {
alert(ex);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment