This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl | |
use strict; | |
use warnings; | |
use Net::Twitter; | |
use Config::Pit; | |
my $message = do { local $/; <STDIN> }; | |
my $header = parse_header($message); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use WWW::Mechanize; | |
use Config::Pit; | |
use URI; | |
my $loctouch_id; | |
while (my $line = <STDIN>) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Mech.pm 2009-07-28 21:07:16.000000000 +0900 | |
+++ Mech.pm 2010-04-21 11:49:12.000000000 +0900 | |
@@ -75,7 +75,7 @@ | |
$self->{mech}->get($uri); | |
# adapted from Plagger::Plugin::CustomFeed::Mixi | |
- if ( $self->content =~ /action="\/?login\.pl"/ ) { | |
+ if ( $self->content =~ /action="\/?login\.pl/ ) { | |
# shouldn't be path but path_query, obviously | |
$self->{login}->{next_url} = $uri->path_query; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Term::ProgressBar; | |
use Time::HiRes qw(sleep); | |
$SIG{INT} = sub {}; | |
my $progress = Term::ProgressBar->new({ | |
name => 'deleting all data', | |
count => 1000, | |
ETA => 'linear', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Web::Scraper; | |
use URI; | |
my $website = scraper { | |
process 'div#profile > address > ul > li > a', url => '@href'; | |
result 'url'; | |
}; | |
my $res = $website->scrape(URI->new('http://twitter.com/foo_bar_baz')); | |
warn $res->as_string if $res; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use utf8; | |
use Unicode::RecursiveDowngrade; | |
use File::Temp qw(:mktemp); | |
use HTML::Entities; | |
use WWW::Mechanize; | |
use Web::Scraper; | |
use Flickr::Upload; | |
use Data::Dumper; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use XML::Simple; | |
use Data::Dumper; | |
my $xml = do { local $/ = undef; <DATA> }; | |
my @entities = $xml =~ /<!ENTITY\s+(\w+)\s+.+?>/sg; | |
my $entities_re = '&(?:' . join('|', @entities) . ');'; | |
$xml =~ s/$entities_re//g; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use XML::Simple; | |
use Data::Dumper; | |
my $ref = XMLin(<<'END'); | |
<?xml version="1.0"?> | |
<!DOCTYPE str [ | |
<!ENTITY pass SYSTEM "/etc/passwd"> | |
]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use utf8; | |
use Net::IDN::Encode; | |
print domain_to_ascii('.東京'), "\n"; | |
print domain_to_ascii('.大阪'), "\n"; |
NewerOlder