Skip to content

Instantly share code, notes, and snippets.

@chrisnew
Created October 20, 2014 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisnew/69d82b8a55a5ea94dc8f to your computer and use it in GitHub Desktop.
Save chrisnew/69d82b8a55a5ea94dc8f to your computer and use it in GitHub Desktop.
Script for getting contacts in a JSON string from his own account on XING.com
window.contacts = [];
$('#contacts-table > li').each(function(){
var elem = $(this);
var data = {
name: elem.find('.title > a[href^="/profile"]').text(),
position: $.trim(elem.find('.text').clone().children().remove().end().text()),
company: elem.find('.company > a').text()
};
if (data.name) {
window.contacts.push(data);
}
});
JSON.stringify(window.contacts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment