-
Notifications
You must be signed in to change notification settings - Fork 0
/
klout.html
35 lines (29 loc) · 1.02 KB
/
klout.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML>
<html>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.klout.com/v2/user.json/1134760/influence?key=u4r7nd3r7bj9ksxfx3cuy6hw&callback=?",
"method": "GET",
"dataType": "jsonp",
"headers": {}
}
$.ajax(settings).done(function (data) {
console.log(data);
$.each( data.myInfluencees, function( i, inf ) {
$("#kloutinfluencees").append('<li><a href="http://twitter.com/'+inf.entity.payload.nick + '">' + inf.entity.payload.nick + '</a></li>');
});
$.each( data.myInfluencers, function( i, inf ) {
$("#kloutinfluencers").append('<li><a href="http://twitter.com/'+inf.entity.payload.nick + '">' + inf.entity.payload.nick + '</a></li>');
});
});
</script>
<h2>My influencees (people I influence)</h2>
<ul id="kloutinfluencees"></ul>
<h2>My influencers (people who influence me)</h2>
<ul id="kloutinfluencers"></ul>
</body>
</html>