Skip to content

Instantly share code, notes, and snippets.

@cristoslc
Created June 25, 2014 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cristoslc/193e1774cbdc68e28234 to your computer and use it in GitHub Desktop.
Save cristoslc/193e1774cbdc68e28234 to your computer and use it in GitHub Desktop.
Snippet to include most recent decks from slideshare
<div id="slideshareEmbed">
</div>
<script>
var userName = 'cristoslc1';
var page = 'http://www.slideshare.net/rss/user/' + userName;
var url = 'http://x.cris.lc/php/getPageContents.php?url=' + page;
jQuery.get(url).done( function(data) { getSlideshareEmbed(data); } );
function getSlideshareEmbed(xml) {
var xmlDoc = jQuery.parseXML(xml),
$xml = jQuery(xmlDoc);
$xml.find('item:first').each(function() {
var $item = jQuery(this);
var title = $item.attr('title');
var embedcode = $item.find('embed').text();
console.log(embedcode);
jQuery('#slideshareEmbed').append('<h3>Recent Presentations</h3>' + embedcode);
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment