Skip to content

Commit dbbf1b3

Browse files
author
adam
committed
update
1 parent d865468 commit dbbf1b3

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

examples/member/profile.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<p>Member Profile JSAPI Demo</p>
2+
<p>This example demonstrates the use of the Profile() API call</p>
3+
<script type="text/javascript">
4+
function getProfile() {
5+
IN.API.Profile("url=http://www.linkedin.com/in/dudcat")
6+
.fields("firstName" , "lastName" , "industry" , "distance" , "summary")
7+
.result(function(res) {
8+
var user = res.values[0],
9+
tmpl = ["<p>{firstName} {lastName} works in " ,
10+
"the {industry} industry. You are {distance} degree(s) " ,
11+
"away in the network. What follows is their summary." ,
12+
"</p><p>{summary}</p>"].join("");
13+
14+
for (var name in user) {
15+
tmpl = tmpl.replace(new RegExp("{"+name+"}" , "g"), user[name]);
16+
}
17+
18+
document.getElementById("profile").innerHTML = tmpl;
19+
});
20+
}
21+
</script>
22+
<script type="IN/Login" data-onAuth="getProfile"></script>
23+
<div id="profile"></div>

examples/member/profile.html~

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<p>Member Profile JSAPI Demo</p>
2+
<p>This example demonstrates the use of the Profile() API call</p>
3+
<script type="text/javascript">
4+
function getProfile() {
5+
6+
IN.API.Profile("url=http://www.linkedin.com/in/dudcat")
7+
.fields("firstName", "lastName", "industry", "distance", "summary")
8+
.result(function(res) {
9+
/* var user = res.values[0],
10+
tmpl = ["<p>{firstName} {lastName} works in ",
11+
"the {industry} industry. You are {distance} degree(s) ",
12+
"away in the network. What follows is their summary.",
13+
"</p><p>{summary}</p>"].join("");
14+
15+
for (var name in user) {
16+
tmpl = tmpl.replace(new RegExp("{"+name+"}", "g"), user[name]);
17+
}
18+
*/
19+
document.getElementById("profile").innerHTML = 'a'; //tmpl;
20+
});
21+
}
22+
</script>
23+
<script type="IN/Login" data-onAuth="getProfile"></script>
24+
<div id="profile"></div>

0 commit comments

Comments
 (0)