Skip to content

Instantly share code, notes, and snippets.

@icheernoom
Last active August 28, 2017 04:13
Show Gist options
  • Select an option

  • Save icheernoom/8415974 to your computer and use it in GitHub Desktop.

Select an option

Save icheernoom/8415974 to your computer and use it in GitHub Desktop.

Revisions

  1. ICheer_No0M revised this gist Jan 14, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion slideshare.pl
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    use LWP::UserAgent;

    if(@ARGV < 2){
    print "Usage : filename.pl <url> <folder_name>";
    print "Usage : filename.pl <slideshare_url> <folder_name>";
    exit;
    }
    $url = $ARGV[0];
  2. ICheer_No0M created this gist Jan 14, 2014.
    21 changes: 21 additions & 0 deletions slideshare.pl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    use LWP::UserAgent;

    if(@ARGV < 2){
    print "Usage : filename.pl <url> <folder_name>";
    exit;
    }
    $url = $ARGV[0];
    $folder = $ARGV[1];
    $browser = LWP::UserAgent->new() or die;
    $content = $browser->get($url)->content;
    $i = 1;
    while($content =~ m/data-normal=\"(.*?)\"/g){
    $pic = $1;
    $img = $browser->get($pic)->content;
    open OUTFILE, ">> ".$folder.'/'.$i.'.jpg';
    binmode OUTFILE;
    print OUTFILE $img;
    close OUTFILE;
    print $pic." => Saved \n";
    $i++;
    }