[MalaWiki] [TitleIndex] [WordIndex]

PbSlidesEsc/356 FlashLookAhead

Flash Lookahead Link Extractor

#!/usr/bin/perl

use LWP::Simple; # used to get linked pages
use URI::URL;    # used to absolutize URLs

sub rel2abs {
        my ($rel,$base) = @_;
        my $uri = URI->new_abs($rel, $base);
        return $uri->as_string;
}

$url   = $ARGV[0];
$flash = get($url) 
         || die "Couldn't download $ARGV[0]";

# SYNTAX IS: 0x00 0x83 0xlen 0x00 "string" 0x00
while ($flash =~ /\x00\x83.\x00(.*?)\x00/gs){
  my $nextitle;
  my $link = rel2abs ($1,$url);
  my $nextpage = get ($link);
  if ($nextpage =~ /<title>(.*?)<\/title>/i){
    $nextitle = $1;
  }else{
    $nextitle = $link;
  }
  print qq|<a href="$link">$nextitle</a><br>\n|;
} 

Usage:

perl flash2.pl http://url.you.like/menu.swf

Search for:


2014-06-11 14:17