View Single Post
Old 10-10-2012, 07:00 PM   PM User | #4
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
there are probably much more efficient ways to do this, but as long as you have the user IDs you can put them into the ids array here:

Code:
<body>
<div id="results"></div>
<script type="text/javascript">
function showUser(o){
document.getElementById("results").innerHTML+=o.query.results.body.div.center.div[0].div.div[3].ul.li[2].span.content.split(" ")[1]+"<br>";
}

var ids=[24880,25580,27380]
for (var i = 0; i < ids.length; i++) {
getUser(ids[i])
}

function getUser(num){
if (document.getElementById("giffgaff")){
document.body.removeChild(document.getElementById("giffgaff"));
}
var myurl=encodeURIComponent("http://community.giffgaff.com/t5/user/viewprofilepage/user-id/"+num)
scr=document.createElement("script");
scr.type="text/javascript";
scr.id="giffgaff"
scr.src='http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22'+myurl+'%2F%22&format=json&callback=showUser';
document.body.appendChild(scr);
}
</script>
</body>
xelawho is offline   Reply With Quote
Users who have thanked xelawho for this post:
wman2 (10-10-2012)