綾小路龍之介の素人思考

E-magazine

"http://www.emaga.com/info/ikkou.html"のようなURLの場合、"http://www.emaga.com/info/"を"wget --post-data="x=x&doui=ok&code="に、この後に続くマガジンIDを残して".html"を"&mail=MAILADDRESS@MAILADDRESS.COMP&regist=購読" http://www.emaga.com/tool/mail.cgi"に置換する。つまり、Perlスクリプト的にはこんな感じです。

print<< 'OUT';
path "C:\Program Files\GnuWin32\bin"
path "D:\temp_prog\wget-1.10.1-bin\bin"
OUT
open IN,"mag.txt";
while(<IN>){
        s/http:\/\/mini.mag2.com\/pc\/m\/(.*)\.html/wget --post-data=\"e=MAILADDRESS\@MAILADDRESS.COMP&id=$1&PC=\" http:\/\/regist.mini.mag2.com\/r\/servlet\/Ma/;
        s/http:\/\/www.mag2.com\/m\/(.*)\.html/wget --post-data=\"MfcISAPICommand=MagRdAdd&rdemail=MAILADDRESS\@MAILADDRESS.COMP&reg=magazine&magid=$1\" http:\/\/regist.mag2.com\/reader\/Magrdadd/;
        s/http:\/\/cgi.kapu.biglobe.ne.jp\/m\/(.*)\.html/wget --post-data=\"mgid=$1&e_mail=MAILADDRESS\@MAILADDRESS.COMP\" http:\/\/cgi.kapu.biglobe.ne.jp\/cgi-bin\/mlmg_setma.cgi/;
        s/(http:\/\/www.ransta.jp\/backnumber_.*)/wget --post-data=\"procregister=dgregist&mailmag=add&email=MAILADDRESS\@MAILADDRESS.COMP\" $1/;
        s/http:\/\/amds.jp\/magazine\/(.*)\.html/wget --post-data=\"number=amds-$1&email=MAILADDRESS\@MAILADDRESS.COMP\" http:\/\/amds.jp\/amds_sub.cgi/;
        s/(http:\/\/www.melma.com\/backnumber_.*)/wget --post-data=\"procregister=dgregist&mailmag=add&email=MAILADDRESS\@MAILADDRESS.COMP\" $1/;
        s/http:\/\/www.emaga.com\/info\/(.*)\.html/wget --post-data=\"x=x&doui=ok&code=$1&mail=MAILADDRESS\@MAILADDRESS.COMP&regist=購読\" http:\/\/www.emaga.com\/tool\/mail.cgi/;
        print;
}
close IN;
wget --post-data="x=x&doui=ok&code=4574&mail=MAILADDRESS@MAILADDRESS.COMP&regist=購読" http://www.emaga.com/tool/mail.cgi

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2006-04-08T05:22:08+09:00
  2. Modified: 2006-04-08T10:29:49+09:00
  3. Generated: 2017-05-22T23:09:17+09:00