Skip to content

Instantly share code, notes, and snippets.

@xatier
Created August 16, 2013 07:45
Show Gist options
  • Save xatier/6248061 to your computer and use it in GitHub Desktop.
Save xatier/6248061 to your computer and use it in GitHub Desktop.
請用心眼填上適當的網址 ;-)
#!/usr/bin/env perl
use 5.014;
use WWW::Mechanize;
use List::MoreUtils qw(uniq);
# iframe printer
sub iframe_p {
my ($title, $id, $url) = @_;
my $mech = WWW::Mechanize->new();
$mech->get($url);
my $ref = $mech->find_all_links( url_regex => qr/pixmicat\.php\?res=\d+$/);
my @queue = ( uniq( reverse sort map { $_->url_abs() } @$ref ) );
say "<div id=\"$id\"> <h1>$title</h1>";
for (@queue) {
say "<iframe src=\"$_\" height=\"850\" width=\"1200\"></iframe><br/><hr/>";
}
say "</div>";
}
say <<END;
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-wip/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1 id="">xatier's K* reader</h1>
<div class="row">
<div class="col-md-3">
<div class="bs-sidebar affix hidden-print" role="complementary">
<ul class="nav bs-sidenav navbar-inverse">
<li class="active"><a href="#">Home</a></li>
<li><a href="#k303">倫理</a></li>
<li><a href="#36_kill">獵奇</a></li>
<li><a href="#22_3b">三次元裏</a></li>
<li><a href="#21_foot">足尻裏</a></li>
</ul>
</div>
</div>
<div class="col-md-8" role="main">
END
iframe_p("倫理", "k303", "");
iframe_p("獵奇注意", "36_kill", "");
iframe_p("三次元裏", "22_3b", "");
iframe_p("足尻裏", "21_foot", "");
say <<END;
</div>
</div>
</div></body></html>
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment