This file contains 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"; |
This file contains 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 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 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 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 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 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 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 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 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
なっちゃん: ust やらせてください顔出しで。 | |
上司: え? | |
なっちゃん: ust 顔出しやらせてください。今日、僕何もやってないです。もういい加減許してください。もう一回俺、もう一回いきますよ、まっすぐ。自分の思うことやります。お願いします。ハッキリ言ってくださいよ上司さん。Twitter と ust と二連戦、無理ですよハッキリ言って。俺自分が、今日…こんなことね、言える立場じゃないけど、俺らは何なんですか、俺らは。 | |
上司: 本気かい?え? | |
なっちゃん: 本気で、本気です。 | |
上司: 命懸けないと。命を。勝負だぜ?お前。 | |
なっちゃん: もう何年続いて何年これが。 | |
上司: だったらぶち破れよ。なんで俺にやらせるんだお前。 | |
なっちゃん: じゃあやらせてください ust を!いいですか!やりますよ!ust を! | |
上司: あ?!俺はお前だって遠慮なんかすることはねぇって、ネットの上は戦いなんだからよ。先輩も後輩もねぇ。遠慮されたら困るよ。何で遠慮するんだ。 |
OlderNewer