Skip to content

Instantly share code, notes, and snippets.

@scharfie
Last active March 15, 2016 21:59
Show Gist options
  • Save scharfie/10ce64247893346a9a9e to your computer and use it in GitHub Desktop.
Save scharfie/10ce64247893346a9a9e to your computer and use it in GitHub Desktop.
A little script that adds one-click blocking of flickr contact from the "people who follow you" page (https://www.flickr.com/people/USERNAME/contacts/rev/)
/*
Script for the "Custom JavaScript" chrome extension (https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija)
*/
var BlockContact = function(contactId, callback) {
var magic_cookie = F.config.flickrAPI.auth_hash;
var data = {
magic_cookie: magic_cookie,
done: 1,
id: contactId,
redire: null,
photoid: null,
setid: null,
galleryid: null,
appid: null,
confirm: 1,
submit: 'BLOCK'
};
$.post("/ignore.gne", data).success(callback);
}
jQuery(function() {
$(".contact-list-fullname a").each(function() {
var self = $(this);
var blockLink = $("<a class='Butt' style='margin-top:-13px;float:right;color:#fff'>BLOCK NOW</a>");
blockLink.click(function() {
var contactId =
self.attr('href').match("/people/(.+)/")[1];
BlockContact(contactId, function() {
self.closest("tr").remove();
});
blockLink.text("Blocking...");
});
blockLink.insertAfter(self);
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment