Hacking SlideShare.net using PHP

Duh! you really believed that tricky title? come on!

But hey, wait. Here’s something I’ve found for you!

I am a big fan of slideshare becoz of their fantastic presentation sharing service and also the display. but it also hurts me when I can’t download some of these awesome slides available there for my offline reading. So I just spent some time today analyzing the HTTP requests made by the player available in slideshare using LiveHTTPHeader extension and found a way to download any presentation you want! There are many slides available in slideshare where you see that “Download not available” – But as long you have some knowledge on web-scrapping, that doesn’t matter at all.

Look at the following PHP code which gives you a list of URLs of the slides from any slideshow in slideshare.net – whether the presentation is available to download or not! for example the presentation on “Ajax and PHP” by John Coggeshall is not available to download. The url is of that presentation is http://www.slideshare.net/coogle/ajax-and-php


<?php
$slideshowUrl="http://www.slideshare.net/coogle/ajax-and-php";
$slideshowPageContent = file_get_contents($slideshowUrl);
$pattern = "~doc=([\w-]+)~";
preg_match($pattern,$slideshowPageContent,$matches);
$xmlurl = "http://s3.amazonaws.com/slideshare/{$matches[1]}.xml";


$sxml = simplexml_load_file($xmlurl);

foreach ($sxml->Slide as $slide)
echo $slide['Src']."<br />";
?>

The output will be something like this

https://s3.amazonaws.com:443/slideshare/ajax-and-php-1194421981517706-1-slide-1.swf
https://s3.amazonaws.com:443/slideshare/ajax-and-php-1194421981517706-1-slide-2.swf
https://s3.amazonaws.com:443/slideshare/ajax-and-php-1194421981517706-1-slide-3.swf
https://s3.amazonaws.com:443/slideshare/ajax-and-php-1194421981517706-1-slide-4.swf
https://s3.amazonaws.com:443/slideshare/ajax-and-php-1194421981517706-1-slide-5.swf
https://s3.amazonaws.com:443/slideshare/ajax-and-php-1194421981517706-1-slide-6.swf
https://s3.amazonaws.com:443/slideshare/ajax-and-php-1194421981517706-1-slide-7.swf
..........
https://s3.amazonaws.com:443/slideshare/ajax-and-php-1194421981517706-1-slide-40.swf

I am sure you are going to love me! 😀