Skip to content

Instantly share code, notes, and snippets.

@SergioLarios
Created November 3, 2016 14:27
Show Gist options
  • Save SergioLarios/cd60879aed54466d7631e4e2b1176017 to your computer and use it in GitHub Desktop.
Save SergioLarios/cd60879aed54466d7631e4e2b1176017 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Your Website</title>
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
api_key: 77n96cw5jr1gb9
onLoad: onLinkedInLoad, onLinkedInAuth
authorize: true
</script>
</head>
<body>
<header>
<nav>
<ul>
<li>Your menu</li>
</ul>
</nav>
</header>
<section>
<article>
<header>
<h2>Article title</h2>
<p>Posted on <time datetime="2009-09-04T16:31:24+02:00">September 4th 2009</time> by <a href="#">Writer</a> - <a href="#comments">6 comments</a></p>
</header>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
</article>
<article>
<header>
<h2>Article title</h2>
<p>Posted on <time datetime="2009-09-04T16:31:24+02:00">September 4th 2009</time> by <a href="#">Writer</a> - <a href="#comments">6 comments</a></p>
</header>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
</article>
</section>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/es_ES/sdk.js#xfbml=1&version=v2.8&appId=1805111279765177";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-page" data-href="https://www.facebook.com/alumni.IESE/" data-tabs="timeline" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="false"><blockquote cite="https://www.facebook.com/alumni.IESE/" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/alumni.IESE/">IESE - Alumni Association</a></blockquote></div>
<div id="displayUpdates"></div>
<script type="text/javascript">
function onLinkedInLoad() {
IN.Event.on(IN, "auth", onLinkedInAuth);
console.log("On auth");
}
function onLinkedInAuth() {
var cpnyID = 2414183; //LinkedIn's testDevCo
IN.API.Raw("/companies/" + cpnyID + "/updates?event-type=status-update&start=0&count=10&format=json")
.result(displayCompanyUpdates);
console.log("After auth");
}
function displayCompanyUpdates(result) {
var div = document.getElementById("displayUpdates");
var el = "<ul>";
var resValues = result.values;
for (var i in resValues) {
var share = resValues[i].updateContent.companyStatusUpdate.share;
var isContent = share.content;
var isTitled = isContent,
isLinked = isContent,
isDescription = isContent,
isThumbnail = isContent;
if (isTitled) {
var title = isContent.title;
} else {
var title = "News headline";
}
if (isLinked) {
var link = isContent.shortenedUrl;
} else {
var link = "#";
}
if (isDescription) {
var description = isContent.description;
} else {
var description = "No description";
}
if (isThumbnailz) {
var thumbnailUrl = isContent.thumbnailUrl;
} else {
var thumbnailUrl = "http://placehold.it/60x60";
}
if (share) {
var content = "<a target='_blank' href=" + link + ">" + title + "</a><br>" + description;
el += "<li><img src='" + thumbnailUrl + "' alt=''>" + content + "</li>";
}
console.log(share);
}
el += "</ul>";
div.innerHTML = el;
}
</script>
<aside>
<h2>About section</h2>
<p>Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
</aside>
<footer>
<p>Copyright 2009 Your name</p>
</footer>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment