Created
October 20, 2014 09:44
-
-
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
This file contains hidden or 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
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