Last active
August 23, 2016 09:52
-
-
Save coderbyheart/2f0f71f4c19b68217e1b899db401ea69 to your computer and use it in GitHub Desktop.
Batch edit XING privacy settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is supposed to be used in the Chrome Console while you are on | |
// https://www.xing.com/contacts/contacts | |
// get these it from using the UI to edit the privacy settings of one of your contact | |
var csrfToken = '…'; | |
var sid = '…'; | |
var settings = 'email=on&phone_mobile=on&address_business=on&im_skype=on&allow_message=on'; | |
$('a[data-edit-permissions]').map(function(idx, el) {return el.getAttribute('data-edit-permissions')}).map(function(idx, id) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("POST", "https://www.xing.com/app/contact", true); | |
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | |
xhr.setRequestHeader("X-CSRF-Token", csrfToken); | |
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); | |
xhr.send('op=setmutual&id=' + id.split('.')[0] + '&sid=' + sid + '&' + settings); | |
return xhr; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment