#!/usr/bin/perl
use strict;
use warnings;
use HTTP::Request::Common;
use LWP::UserAgent;
my $api_url = "http://www.tumblr.com/api/write";
my $email = 'yto@example.com';
my $password = 'PASSWORD';
my $group = "ytotumblrapitest.tumblr.com";
my $date = "2010-01-01";
my $type;
$type = "quote";
$type = "link";
$type = "regular";
### regular
my $title = "たつをの ChangeLog";
my $body = "アルファブロガー(笑)<br>チェンジログ(笑)<br>ご長寿ブロガー(笑)";
### link
my $name = "たつをの ChangeLog";
my $url = "http://chalow.net/";
my $description = "アルファブロガー(笑)";
### quote
my $quote = "主にコンピュータ技術者向けの話題を提供し続ける情報サイトです。";
my $source = qq(<a href="http://chalow.net/">たつをの ChangeLog</a> だよ!);
#my $source = "http://chalow.net/";
my $req = HTTP::Request::Common::POST(
$api_url,
[
email => $email,
password => $password,
# date => $date,
group => $group,
type => $type,
name => $name,
url => $url,
description => $description,
title => $title,
body => $body,
quote => $quote,
source => $source,
]
);
my $ua = LWP::UserAgent->new();
my $res = $ua->request($req);
#use Data::Dumper; print Dumper($res),"\n";
print "$res->{_rc} http://$group/post/$res->{_content}\n";
#!/usr/bin/perl
use strict;
use warnings;
my $pw = shift @ARGV;
print "original:$pw\n";
$pw =~ s%(.)%join"",map{tr/0-9a-f/a-p/;$_}int(rand(10)),unpack('H2',$1)%ge;
print "encoded:$pw\n";
$pw =~ s%.(..)%($a=$1)=~tr/a-p/0-9a-f/;pack('H2',$a)%ge;
print "decoded:$pw\n";
% ./ungo.pl this.is-pw original:this.is-pw encoded:ehehgiagjihdgcoagjihdhcnahabhh decoded:this.is-pw
適用後:my $email = 'yto@example.com'; my $password = "this.is-pw";
my $email = 'yto@example.com';
my $password = "ehehgiagjihdgcoagjihdhcnahabhh";
$password =~ s%.(..)%($a=$1)=~tr/a-p/0-9a-f/;pack('H2',$a)%ge;
