メイン

2004年4月 9日

post2mt 2.3; bugfix and new features

Post2MTをバグフィックス&機能追加しました。

ダウンロード
http://japo.net/miya/post2mt-current.tar.gz


本バージョンでの変更の概要
・ネストされたマルチパート処理の誤りを修正
・MaiLogで追加された画像情報、GPS情報の取り込みをサポート
・MaiLogで追加されたフォトログ対応および画像分割をサポート


尚、XMLRPCサポートはMaiLogでのみ行われます。

2004年2月12日

Post2mt v2.21 bug fix version

Post2MTをバグフィックスしました。(他の変更なし) ダウンロード http://japo.net/miya/post2mt-current.tar.gz 本バージョンでの変更の概要 ・画像添付のないメール受信時、本文中のタグをチェックしていなかったものを修正。 *Note* XML-RPC対応はv3.0となる予定で、本バージョンには含まれません。 postmt.pl v2.21 Feb 12, 2004 Recent http://japo.net/miya/archives/catlist_post2mt.html Configuration [quote][code] # post2mt.pm: post2mt Configuration file # if you use japanese, you must write it in character set EUC-JP # (blog name, category name) package post2mt; # Set configuration variables my %PTCFG; $PTCFG{BLOG_NAME} = "blogname"; #blog name $PTCFG{BLOG_UNAME} = "username"; #blog user name $PTCFG{BLOG_CNAME} = "maillog"; #default category name $PTCFG{IMG_DIR} = "/path/to/image/dir"; #image directory path $PTCFG{IMG_URL} = "http://url/to/image/dir"; #image direcotry URL # thumbnail $PTCFG{MAKETHUMB} = 2; #0: not 1: browser 2: thumbnail file $PTCFG{MAX_W} = "188"; #width of thumbnail $PTCFG{MAX_H} = "230"; #height of thumbnail # pop3 $PTCFG{USE_POP3} = 0; # 0: not use(command) 1: use POP3 2: APOP $PTCFG{POP3_USER} = "account"; #POP3 account $PTCFG{POP3_PWD} = "password"; #POP3 password $PTCFG{POP3_SERVER} = "hostname"; #POP3 server # security # check From: from=>signature %MAILDEF = ( # check From: from,signature strings # followed are samples 'miya@examle.com' => "Photo by miya (DSC-T1)", 'miya@site.example.com' => "", # no signature 'miya@mobile.example.com' => "Photo by miya (A5401CA)", ); sub getconfig { my ($key) = @_; return $PTCFG{$key}; } sub getmaildef { my ($em) = @_; return "__ERROR__" unless defined $MAILDEF{$em}; return $MAILDEF{$em}; } 1; # end of config file [/code][/quote] Summary of post2mt - You may post an entry from e-mail to Movable Type. You can use carrier such as DoCoMo, au(kddi), and vodafone. And of course, usual PC's e-mail. - You might prepare an exclusive e-mail address for post2mt. (pop3 or .forward/.qmail-xx) When you use aliases, you don't need it. - You can include text, tag and image files in your multi-part e-mail. Two types such as text and image are supported. Another types such as sound, movie are not. - You must write subject in e-mail. And text or images or both must follow. - Images must be formatted in BASE64 or quoted-printable in multi-part. - When post2mt receives an e-mail, post2mt post an entry and rebuild index quickly and ping if you set ping URL(s) at blog. - Post2mt now supports one of security matter. You must configure it in post2mt.pm. There is at least one pair of From: address and signature. Post2mt doesn't receive mail from address(From: ) which is not set in post2mt.pm. And if there was set a signature, post2mt locate it at end of the entry. - Thumbnail - If you specify MAKETHUMB = 0, post2mt doesn't touch image files. Only makes HTML img tag. - If you specify MAKETHUMB = 1, post2mt makes HTML with thumbnail but doesn't make thumbnail file. And you will got a thumbnail with specified size.(Max) - If you specify MAKETHUMB = 2, post2mt makes HTML with thumbnail and makes thumbnail file with specified size.(Max) - At last, if there was thumbnail, post2mt rounds it by one line border. - tags - {MORE} You can use this tag to enter followed text into "Extended". - {CAT cat-name} You can use this tag(s) to specify sub-category name(s). The default category name which was specified in post2mt.pm is always main category name.(BLOG_CNAME) - {IMG left|right|none [rot90|rot180|rot270]} You can use this tags to posit an image(s) at here. If no tag were specified, posit text and images are followed. If you specify this tag sometimes, it means posit some images at there. If you specify rot90, rot180 or rot270, post2mt rotate image specified degrees. rot90 means rotate 90 degrees clockwise. - {DRAFT} You can use this tag to enter an entry as draft. If you didn't specify this tag, post2mt will publish the entry in public. Requirement - Linux/FreeBSD/Unix (i tested on linux) - perl 5 - Image::Magick - MIME::Parser - MIME::Base64 - MIME::QuotedPrint - Mail::Header - Mail::Address - Mail::Internet - File::Temp - Jcode - Net::POP3 - Digest::MD5 (if you use APOP) - others *note: I didn't try/test post2mt in windows environment. Install - make sure your environment. - permission of post2mt.pl will be 0755. - when you use pop3 feature, make post2mt.pm permission 0600 and owner you. In another case, make permission 0644. - make image directory. permission will be 0757. - make sure post2mt.pm to adapt your environment. - make sure "aliases", ".forward" if your MTA is sendmail/postfix/exim/.. "|(/path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir)" - make sure ".qmail-xxx" if your MTA is qmail. /path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir - make sure post2mt.pm if you use POP3. And set cron to launch post2mt.pl on each intervals. 10,20,30,40,50 * * * * /path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir /path/to/post2mt.pl is a place where post2mt.pl is. /path/to/MT-dir is MT directory path name where MT is installed. /path/to/post2mt.pm-dir is directory path name where post2mt.pm is. *note: if you make some of post2mt.pm, change directory name but don't change name "post2mt.pm". WARNING - post2mt has security issue so you don't tell e-mail address for post2mt to anyone. - Take risks to use post2mt by yourself. Author of post2mt don't care it. Special thanks - I learned some of Movable Type API from email2blog.pl. I would like to say "thank you" to email2blog.pl's author. LICENSE You might be permitted to use post2mt freely for personal purpose. You are not permitted to use post2mt for commercial purpose without a license from author. Please ask author whether you can use or not if you are not clear. Author - miya http://japo.net/miya/

サンプル3

picturepicturepicture
rpc

携帯にはタグを登録しておかないとね!


[Photo by miya (A5401CA)]

サンプル2

picturepicture
perl api



[Photo by miya A5401CA]

サンプル

picturerpc

[Photo by miya (A5401CA)]

2004年2月11日

post2mt: 大バグ - 今までの全バージョン

post2mt v2.2で、画像が添付されていない、つまりシングルパートのメールを
受信した際、タグの処理がなされていなかった事が判明した。

境界試験がなされていなかったということですね。
済みません。


[Mew version 3.2 on Emacs 20.7 / Mule 4.1 (葵)]

Re: post2mt: XML-RPCでの1st POST

なるほど!

[MT]/lib/MT/XMLRPCServer.pmから

## In 2.1 we changed the behavior of the $publish flag. Previously,
## it was used to determine the post status. That was a bad idea.
## So now entries added through XML-RPC are always set to publish,
## *unless* the user has set "NoPublishMeansDraft 1" in mt.cfg, which
## enables the old behavior.

なるほどね、XML-RPCからのエントリは常にRelease状態となるわけだ。
変更はできるけど、MT全体に影響する事になるわけですね。

制限事項ってことにしましょう。


[Mew version 3.2 on Emacs 20.7 / Mule 4.1 (葵)]

post2mt: XML-RPCでの1st POST

post2mtをXML-RPC対応にしました。

post2mtのほとんどの機能は対応できるようですが、やはり唯一、ドラフトと
してエントリを作成する事ができません。(perl APIで云うhold/release status)

もし、こうすれば行けるよというものがあれば、ぜひお教えください。

このバージョンはまだMovable Type以外で試してもいないので、幾つか他の
blogシステムで試してから公開しようかなと考えています。

それが済めば、いわゆるmoblog的なものも作成できるので、そっちの方向に
行くのもいいかなと。

バリバリ使って試してやるよという猛者がいらっしゃれば、それもお願いした
いなと。よろしくお願いします。

左の写真はお馴染(^^)オランジェリーの独白です。しばらくオランジュリーに
もご無沙汰なんで、また行ってみようかな。新しいものがあるといいな。
(これはサンプル文ですよ)



[Photo by miya DSC-T1]
[Mew version 3.2 on Emacs 20.7 / Mule 4.1 (葵)]

2004年2月 7日

Post2mt v2.2 バージョンアップ

Post2MTをバージョンアップしました。 ダウンロード 最新版をダウンロードしてください。 ご注意 ・環境設定ファイル post2mt.pm が変更になりました。 本バージョンでの変更の概要 ・post2mt.pmにて定義したメールアドレス(From:)以外からのメールは受け取らなくなった。 ・上記メールアドレスに対応して、シグネチャを定義できるようになった。そのシグネチャは記事の最後に追加される。 ・{IMG }タグが機能強化された。IMGタグに rot90/rot180/rot270 を付け加えられるようになり、それぞれ90度、180度、270度、画像を回転できるようになった。例えば、ドコモの携帯でiショット(L)を横向で撮影した場合、送られてくる画像は縦置きである。そこでそれを横向に90度回転させて表示すると意図通りの構図となる。 サンプル オリジナル rot90 postmt.pl v2.2 Feb 7, 2004 Recent http://japo.net/miya/archives/cat_post2mt.php Configuration [quote][code] # post2mt.pm: post2mt Configuration file # if you use japanese, you must write it in character set EUC-JP # (blog name, category name) package post2mt; # Set configuration variables my %PTCFG; $PTCFG{BLOG_NAME} = "blogname"; #blog name $PTCFG{BLOG_UNAME} = "username"; #blog user name $PTCFG{BLOG_CNAME} = "maillog"; #default category name $PTCFG{IMG_DIR} = "/path/to/image/dir"; #image directory path $PTCFG{IMG_URL} = "http://url/to/image/dir"; #image direcotry URL # thumbnail $PTCFG{MAKETHUMB} = 2; #0: not 1: browser 2: thumbnail file $PTCFG{MAX_W} = "188"; #width of thumbnail $PTCFG{MAX_H} = "230"; #height of thumbnail # pop3 $PTCFG{USE_POP3} = 0; # 0: not use(command) 1: use POP3 2: APOP $PTCFG{POP3_USER} = "account"; #POP3 account $PTCFG{POP3_PWD} = "password"; #POP3 password $PTCFG{POP3_SERVER} = "hostname"; #POP3 server # security # check From: from=>signature %MAILDEF = ( # check From: from,signature strings # followed are samples 'miya@examle.com' => "Photo by miya (DSC-T1)", 'miya@site.example.com' => "", # no signature 'miya@mobile.example.com' => "Photo by miya (A5401CA)", ); sub getconfig { my ($key) = @_; return $PTCFG{$key}; } sub getmaildef { my ($em) = @_; return "__ERROR__" unless defined $MAILDEF{$em}; return $MAILDEF{$em}; } 1; # end of config file [/code][/quote] Summary of post2mt - You may post an entry from e-mail to Movable Type. You can use carrier such as DoCoMo, au(kddi), and vodafone. And of course, usual PC's e-mail. - You might prepare an exclusive e-mail address for post2mt. (pop3 or .forward/.qmail-xx) When you use aliases, you don't need it. - You can include text, tag and image files in your multi-part e-mail. Two types such as text and image are supported. Another types such as sound, movie are not. - You must write subject in e-mail. And text or images or both must follow. - Images must be formatted in BASE64 or quoted-printable in multi-part. - When post2mt receives an e-mail, post2mt post an entry and rebuild index quickly and ping if you set ping URL(s) at blog. - Post2mt now supports one of security matter. You must configure it in post2mt.pm. There is at least one pair of From: address and signature. Post2mt doesn't receive mail from address(From: ) which is not set in post2mt.pm. And if there was set a signature, post2mt locate it at end of the entry. - Thumbnail - If you specify MAKETHUMB = 0, post2mt doesn't touch image files. Only makes HTML img tag. - If you specify MAKETHUMB = 1, post2mt makes HTML with thumbnail but doesn't make thumbnail file. And you will got a thumbnail with specified size.(Max) - If you specify MAKETHUMB = 2, post2mt makes HTML with thumbnail and makes thumbnail file with specified size.(Max) - At last, if there was thumbnail, post2mt rounds it by one line border. - tags - {MORE} You can use this tag to enter followed text into "Extended". - {CAT cat-name} You can use this tag(s) to specify sub-category name(s). The default category name which was specified in post2mt.pm is always main category name.(BLOG_CNAME) - {IMG left|right|none [rot90|rot180|rot270]} You can use this tags to posit an image(s) at here. If no tag were specified, posit text and images are followed. If you specify this tag sometimes, it means posit some images at there. If you specify rot90, rot180 or rot270, post2mt rotate image specified degrees. rot90 means rotate 90 degrees clockwise. - {DRAFT} You can use this tag to enter an entry as draft. If you didn't specify this tag, post2mt will publish the entry in public. Requirement - Linux/FreeBSD/Unix (i tested on linux) - perl 5 - Image::Magick - MIME::Parser - MIME::Base64 - MIME::QuotedPrint - Mail::Header - Mail::Address - Mail::Internet - File::Temp - Jcode - Net::POP3 - Digest::MD5 (if you use APOP) - others *note: I didn't try/test post2mt in windows environment. Install - make sure your environment. - permission of post2mt.pl will be 0755. - when you use pop3 feature, make post2mt.pm permission 0600 and owner you. In another case, make permission 0644. - make image directory. permission will be 0757. - make sure post2mt.pm to adapt your environment. - make sure "aliases", ".forward" if your MTA is sendmail/postfix/exim/.. "|(/path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir)" - make sure ".qmail-xxx" if your MTA is qmail. /path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir - make sure post2mt.pm if you use POP3. And set cron to launch post2mt.pl on each intervals. 10,20,30,40,50 * * * * /path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir /path/to/post2mt.pl is a place where post2mt.pl is. /path/to/MT-dir is MT directory path name where MT is installed. /path/to/post2mt.pm-dir is directory path name where post2mt.pm is. *note: if you make some of post2mt.pm, change directory name but don't change name "post2mt.pm". WARNING - post2mt has security issue so you don't tell e-mail address for post2mt to anyone. - Take risks to use post2mt by yourself. Author of post2mt don't care it. Special thanks - I learned some of Movable Type API from email2blog.pl. I would like to say "thank you" to email2blog.pl's author. LICENSE You might be permitted to use post2mt freely for personal purpose. You are not permitted to use post2mt for commercial purpose without a license from author. Please ask author whether you can use or not if you are not clear. Author - miya http://japo.net/miya/

2004年2月 2日

Post2MT v2.1 バージョンアップ

Post2MT v2.1 Post2MTをバージョンアップしました。 ダウンロード 最新版をダウンロードしてください。 ご注意 ・ライセンス条項が変わりました。ご注意ください。 本バージョンでの変更の概要 ・MTのPublishCharsetをMTから得るように変更したので設定から削除。 ・au携帯での画像回転機能を削除。 ・{MORE}タグを設けそれ以後のテキストをEXTENDEDへ入れる事にした。それに 伴い、5個以上の改行の後のテキストをEXTENDEDへ入れる機能を削除。 ・サムネイル画像を作らない・ブラウザ依存・実際に作るのいずれかを設定で 選択できるように変更した。 ・作成した画像ファイルのパーミッションを0644から0666に変更。 [code] postmt.pl v2.1 Feb 1, 2004 Download http://japo.net/miya/post2mt-2.1.tar.gz Configuration # post2mt.pm: post2mt Configuration file # if you use japanese, you must write it in character set EUC-JP # (blog name, category name) package post2mt; # Set configuration variables my %PTCFG; $PTCFG{BLOG_NAME} = "blogname"; #blog name $PTCFG{BLOG_UNAME} = "username"; #blog user name $PTCFG{BLOG_CNAME} = "maillog"; #default category name $PTCFG{IMG_DIR} = "/path/to/image/dir"; #image directory path $PTCFG{IMG_URL} = "http://url/to/image/dir"; #image direcotry URL # thumbnail $PTCFG{MAKETHUMB} = 2; #0: not 1: browser 2: thumbnail file $PTCFG{MAX_W} = "188"; #width of thumbnail $PTCFG{MAX_H} = "230"; #height of thumbnail # pop3 $PTCFG{USE_POP3} = 0; # 0: not use(command) 1: use POP3 2: APOP $PTCFG{POP3_USER} = "account"; #POP3 account $PTCFG{POP3_PWD} = "password"; #POP3 password $PTCFG{POP3_SERVER} = "hostname"; #POP3 server sub getconfig { my ($key) = @_; return $PTCFG{$key}; } 1; # end of config file Summary of post2mt - You may post an entry from e-mail to Movable Type. You can use carrier such as DoCoMo, au(kddi), and vodafone. And of course, usual PC's e-mail. - You might prepare an exclusive e-mail address for post2mt. (pop3 or .forward/.qmail-xx) When you use aliases, you don't need it. - You can include text, tag and image files in your multi-part e-mail. Two types such as text and image are supported. Another types such as sound, movie are not. - You must write subject in e-mail. And text or images or both must follow. - Images must be formatted in BASE64 or quoted-printable in multi-part. - When post2mt receives an e-mail, post2mt post an entry and rebuild index quickly and ping if you set ping URL(s) at blog. - Thumbnail - If you specify MAKETHUMB = 0, post2mt doesn't touch image files. Only makes HTML img tag. - If you specify MAKETHUMB = 1, post2mt makes HTML with thumbnail but doesn't make thumbnail file. And you will got a thumbnail with specified size.(Max) - If you specify MAKETHUMB = 2, post2mt makes HTML with thumbnail and makes thumbnail file with specified size.(Max) - tags - {MORE} You can use this tag to enter followed text into "Extended". - {CAT cat-name} You can use this tag(s) to specify sub-category name(s). The default category name which was specified in post2mt.pm is always main category name.(BLOG_CNAME) - {IMG left} {IMG right} You can use this tags to posit an image(s) at here. If no tag were specified, posit text and images are followed. If you specify this tag sometimes, it means posit some images at there. - {DRAFT} You can use this tag to enter an entry as draft. If you didn't specify this tag, post2mt will publish the entry in public. Requirement - Linux/FreeBSD/Unix (i tested on linux) - perl 5 - Image::Magick - MIME::Parser - MIME::Base64 - MIME::QuotedPrint - Mail::Header - Mail::Internet - File::Temp - Jcode - Net::POP3 - Digest::MD5 (if you use APOP) - others *note: I didn't try/test post2mt in windows environment. Install - make sure your environment. - permission of post2mt.pl will be 0755. - when you use pop, make post2mt.pm permission 0600 and owner you when you use POP3 feature. In another case, make permission 0644. - make image directory. permission will be 0757. - make sure post2mt.pm to adapt your environment. - make sure "aliases", ".forward" if your MTA is sendmail/postfix/exim/.. "|(/path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir)" - make sure ".qmail-xxx" if your MTA is qmail. /path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir - make sure post2mt.pm if you use POP3. And set cron to launch post2mt.pl on each intervals. 10,20,30,40,50 * * * * /path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir /path/to/post2mt.pl is a place where post2mt.pl is. /path/to/MT-dir is MT directory path name where MT is installed. /path/to/post2mt.pm-dir is directory path name where post2mt.pm is. *note: if you make some of post2mt.pm, change directory name but don't change name "post2mt.pm". WARNING - post2mt has security issue so you don't tell e-mail address for post2mt to anyone. - Take risks to use post2mt by yourself. Author of post2mt don't care it. Special thanks - I learned some of Movable Type API from email2blog.pl. I would like to say "thank you" to email2blog.pl's author. LICENSE You might be permitted to use post2mt freely for personal purpose. You are not permitted to use post2mt for commercial purpose without a license from author. Please ask author whether you can use or not if you are not clear. Author - miya http://japo.net/miya/ [/code]

2004年1月25日

postmt.pl v2.0.1

更新: 2004/1/25 プログラムにtypoがありましたので、修正。 post2mtはメールからMTにエントリするプログラムです。 様々な環境のインストールはさほど必要ありません。 新たに追加・変更となった機能(v2.0) ・POP3サーバからメールを受信してMTに投稿できるようになった。(APOP可) ・環境ファイルが変更となった。 ダウンロード 最新版をダウンロードしてください。 新たに追加となった機能(v1.2.1) ・au端末での画像回転用リンクの付与。(オプション) ・テキストのTEXT_MOREへの追加。(オプション) ・環境設定のテキストファイル化 ・カテゴリ名の動的な指定。(オプション) ・画像の位置指定(とalign指定)。(オプション) ・MTのPublishCharsetの指定。(オプション) ・ドラフト(下書き)としてMTに投稿する指定。 ・画像ファイル名はオリジナルのファイル名を出来るだけ尊重するようにしました。但し、日本語ファイル名は残しません。 post2mtの環境設定ファイルは以下のようになります。(post2mt.pm) これをwwwからアクセスできない場所に置くのがいいでしょう。 もちろん、post2mt.pl自体もwwwからアクセスできない場所に置くのが望まし いです。 [quote][code] # post2mt.pl 環境ファイル # このファイルの日本語文字コードはEUCであること! package post2mt; # Set configuration variables my %PTCFG; $PTCFG{BLOG_NAME} = "blogname"; #blog名 $PTCFG{BLOG_UNAME} = "username"; #blogユーザ名 $PTCFG{BLOG_CNAME} = "maillog"; #blogカテゴリ名 $PTCFG{IMG_DIR} = "/path/to/image/dir"; #画像ディレクトリ $PTCFG{IMG_URL} = "http://url/to/image/dir"; #画像ディレクトリURL $PTCFG{MAX_W} = "188"; #画像サムネイル化幅 $PTCFG{MAX_H} = "230"; #画像サムネイル化縦 $PTCFG{AU_ROTATE_URL} = "http://url/to/rotate.gif"; #auでファイルサイズが大きい時回転画像を用意する #その際表示させる画像 #これを指定しないと回転画像は用意しない $PTCFG{TEXT_MORE} = 1; #5行以上空行があればそれ以降をmoreに入れる $PTCFG{CHARSET} = "utf8"; #MTのPublishCharsetと同じもの(utf8/euc) $PTCFG{USE_POP3} = 0; # 0: not use(command) 1: use POP3 apop: APOP $PTCFG{POP3_USER} = "account"; #POP3 account $PTCFG{POP3_PWD} = "password"; #POP3 password $PTCFG{POP3_SERVER} = "hostname"; #POP3 server sub getconfig { my ($key) = @_; return $PTCFG{$key}; } 1; # end of config file [/code][/quote] post2mt.pl概要 ・メール(e-mail, DoCoMo iモードメール, iショットメール, au e-mail, フォ トメール, and maybe vodafone e-mail, 写メール)からMovable Type(MT)にエ ントリできます。 ・画像は複数個あれば一つのエントリに全部入れます。 ・サポートしているものは、テキストと画像のみです。それ以外のものは取り 込みません。 ・エントリは、画像があれば画像を先に本文があればその後本文になります。 ・サブジェクトは必須でそれがタイトルになり、一つ以上の画像もしくは本文 いずれかが必須となります。もちろん両方あっても構いません。 ・画像はサイズがデフォルトでは(188x230)まではそのままエントリに張り付 けます。それを越える画像の場合は、エントリ上はサムネールが表示され、画 像をクリックするとpop upウインドウに実サイズで表示します。サムネールを 作成する際は縦横の比率を守ります。サムネールの最大の大きさはデフォルト では(188x230)です。 ・au端末から幅が640以上の画像が送られて来た際、AU_ROTATE_URLに rotate.gifのURLが指定されていれば、90度回転した画像も一緒に作成します。 また、サムネールの横にそれを表示しるイメージ(rotate.gif)を張り付けます。 ・TEXT_MOREが0以外の場合、本文中に改行が5つ以上連続して現れたなら、そ れ以後をTEXT_MOREに格納します。 ・本文で、タグ {CAT カテゴリ名} が指定されていると、それらをセカンダリカテゴリ名とみなし、そのカテゴリ 名でエントリを作成します。プライマリカテゴリは常にpost2mt.cfgで指定さ れたBLOG_CNAMEになります。 ・本文で、タグ {IMG right}、{IMG left}、もしくは {IMG none} が指定されていたなら、画像のalignをleft、rightもしくはnoneとします。本 文は画像に回り込むことになります。また、画像をそのタグのある位置に配置 します。画像の順番は添付の順になります。 ・本文で、タグ {DRAFT} が指定されていると、このエントリはドラフト(下書き)として投稿されます。 ・専用メールアドレスにメールを出すと即時にblogが更新(自動ビルド)されま す。 ・blogにping設定がされていれば、自動的に更新pingが為されます。 必要な環境 ・専用メールアドレス(aliasでも可。POP3ではPOP3アカウント) ・post2mt用blog、カテゴリ、ユーザ(MT) これらは専用でなくても構いません。 ・perl 5以上 ・Image::Magick ・MIME::Parser ・MIME::Base64 ・MIME::QuotedPrint ・Mail::Header ・Mail::Internet ・File::Temp ・Jcode ・Net::POP3 ・Digest::MD5 (APOP利用の場合) ・その他 インストール ・必要な環境を整えます ・post2mt.plのパーミッションは0755にしてください。 ・pop機能を使う場合、post2mt.pmのパーミッションは0600にしてください。 所有ユーザはpopアカウントユーザにしてください。(内容にアカウント名と パスワードが含まれるため)もし、aliasesや.forwardを利用するなら0644と してください。 ・post2mt.pmの内容に日本語が含まれていますが、日本語コードは必ずEUCにしてください。 ・画像用ディレクトリを作ります。パーミッションは0757としてください。 ・回転画像リンクのためのrotate.gifをwwwからアクセスできる適当な場所に 置いてください。(上記画像用ディレクトリ中が望ましい)パーミッションは 0644としてください。 ・post2mt.cfgを変更して、あなたの環境に合わせるように設定してください。 ・専用メールアドレスに.forwardを設置します。(aliasesでももちろんOk) [quote][code]"|(/path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir)" [/code][/quote] ここで、 /path/to/post2mt.pl は、post2mt.plが置かれている場所 /path/to/MT-dir はMTのインストールディレクトリパス名 /path/to/post2mt.pm-dir はpost2mt.pmが置かれているディレクトリ名 となります。 ※環境設定ファイルpost2mt.pmはアカウント毎に作成可能です。ディレクトリ 名は任意ですが、ファイル名は変えてはいけません。 ・POP機能を使う場合は、cronを使います。 [quote][code]/path/to/post2mt.pl /path/to/MT /path/to/post2mt.cfg [/code][/quote] をcrontabで設定してください。例えば以下のようになります。 [quote][code]10,20,30,40,50 * * * * /path/to/post2mt.pl /path/to/MT-dir /path/to/post2mt.pm-dir [/code][/quote](10分毎に起動) 注意点 ・セキュリティ対策はまだ為されていません。メールアドレスが知られる事の ないようにしてください。 ・Windows環境では一切テストしていません。 ・post2mtを利用した事により、利用者が何らかの不利益を被ったとしても、作 者は一切の賠償責任は負いません。 謝辞 ・mail2blog には色々と勉強させてもらいました。特にMTについて。 作者 miya@japo.net http://japo.net/miya/

2004年1月24日

Post2MTにPOP受信機能を付けようかな?

Post2MTを作った際にはWindowsを全く考慮していなかったのですが、Windowsでの需要だってあるんですね。
N&Nさんの所でPOP受信機能があればうまく行くなら、POP受信機能を付けてもいいかなと。
ただ、POPと言っても千差万別あるようなので、果たして本当にWindowsでもうまく動くのかどうか、、
まあ、やってみましょう。

Post2MT作成時のポリシーをちょっと述べておきます。

Post2MTでPOP受信機能を付けなかったのは、単にPOPだとアカウントが必要になるからという理由です。aliasesから外部プログラム起動できればそれに越したことはなくて、一般アカウントでも.forwardや.qmail-xxxx-yyyyが使えれば同じ事ができます。(特にqmailでは一つアカウントがあれば無数に異なる転送(外部プログラム起動)ができるので便利ですよね。
また、外部プログラム起動であればMLのメールをblogに転送することも簡単です。

なぜXML-RPCでやらなかったかといえば、MTに特化した高機能な事ができないからです。ただ、これは私が不勉強で知らないだけかもしれません。

2004年1月 6日

post2mt v1.2.1

post2mtはメールからMTにエントリするプログラムです。
色んな環境のインストールは不要です。

新たに追加となった機能(v1.2.1)

・au端末での画像回転用リンクの付与。(オプション)
・テキストのTEXT_MOREへの追加。(オプション)
・環境設定のテキストファイル化
・カテゴリ名の動的な指定。(オプション)
・画像の位置指定(とalign指定)。(オプション)
・MTのPublishCharsetの指定。(オプション)
・ドラフト(下書き)としてMTに投稿する指定。(オプション)
・画像ファイル名はオリジナルのファイル名を出来るだけ尊重するようにしました。但し、日本語ファイル名は残しません。


ダウンロード

最新版をダウンロードしてください。

post2mtの環境設定ファイルは以下のようになります。(post2mt.cfg)
これをwwwからアクセスできない場所に置くのがいいでしょう。
もちろん、post2mt.pl自体もwwwからアクセスできない場所に置くのが望ましいです。


# post2mt.pl 環境ファイル
# このファイルの日本語文字コードはEUCであること!

sub init_config
{

my %PTCFG = (
BLOG_NAME=>"blog", #blog名
BLOG_UNAME=>"username", #blogユーザ名
BLOG_CNAME=>"category", #blogカテゴリ名
IMG_DIR=>"/path/to/image/dir", #画像ディレクトリ
IMG_URL=>"http://url/to/image/dir", #画像ディレクトリURL
MAX_IMG_W=>"288", #画像サムネイル化幅
MAX_IMG_H=>"352", #画像サムネイル化縦
AU_ROTATE_URL=>"http://url/to//rotate.gif",
#auでファイルサイズが大きい時回転画像を用意する
#その際表示させる画像
#これを指定しないと回転画像は用意しない
TEXT_MORE=>1, #5行以上空行があればそれ以降をtext_moreに入れる
CHARSET=>"utf8", #MTのPublishCharsetと同じもの(utf8/euc)
);

return ($PTCFG{BLOG_NAME},$PTCFG{BLOG_UNAME},$PTCFG{BLOG_CNAME},
$PTCFG{IMG_DIR},$PTCFG{IMG_URL},$PTCFG{MAX_IMG_W},$PTCFG{MAX_IMG_H},
$PTCFG{AU_ROTATE_URL},$PTCFG{TEXT_MORE},$PTCFG{CHARSET});
}
1;
# end of config file


post2mt.pl概要

・メール(e-mail, DoCoMo iモードメール, iショットメール, au e-mail, フォトメール, and maybe vodafone e-mail, 写メール)からMovable Type(MT)にエントリできます。
・画像は複数個あれば一つのエントリに全部入れます。
・サポートしているものは、テキストと画像のみです。それ以外のものは取り込みません。
・エントリは、画像があれば画像を先に本文があればその後本文になります。
・サブジェクトは必須でそれがタイトルになり、一つ以上の画像もしくは本文いずれかが必須となります。もちろん両方あっても構いません。
・画像はサイズがデフォルトでは(288x352=iショットLのサイズ)まではそのままエントリに張り付けます。それを越える画像の場合は、エントリ上はサムネールが表示され、画像をクリックするとpop upウインドウに実サイズで表示します。サムネールを作成する際は縦横の比率を守ります。サムネールの最大の大きさはデフォルトでは(288x352)です。
・au端末から幅が640以上の画像が送られて来た際、AU_ROTATE_URLにrotate.gifのURLが指定されていれば、90度回転した画像も一緒に作成します。また、サムネールの横にそれを表示するイメージ(rotate.gif)を張り付けます。
・TEXT_MOREが0以外の場合、本文中に改行が5つ以上連続して現れたなら、それ以後をTEXT_MOREに格納します。
・本文で、タグ

{CAT カテゴリ名}
が指定されていると、それらをセカンダリカテゴリ名とみなし、そのカテゴリ名でエントリを作成します。このタグは複数個指定できます。プライマリカテゴリは常にpost2mt.cfgで指定されたBLOG_CNAMEになります。
・本文で、タグ
{IMG right}、{IMG left}、もしくは {IMG none}
が指定されていたなら、画像のalignをleft、rightもしくはnoneとします。本文は画像に回り込むことになります。また、画像をそのタグのある位置に配置します。画像の順番は添付の順になります。
・本文で、タグ
{DRAFT}
が指定されていると、このエントリはドラフト(下書き)として投稿されます。

・専用メールアドレスにメールを出すと即時にblogが更新(自動ビルド)されます。
・blogにping設定がされていれば、自動的に更新pingが為されます。

必要な環境

・専用メールアドレス
・post2mt用blog、カテゴリ、ユーザ(MT) これらは専用でなくても構いません。
・perl 5以上
・Image::Magick
・MIME::Parser
・その他


インストール

・必要な環境を整えます
・post2mt.plのパーミッションは0755にしてください。
・post2mt.cfgのパーミッションは0644にしてください。内容に日本語が含まれていますが、日本語コードは必ずEUCにしてください。
・画像用ディレクトリを作ります。パーミッションは0757としてください。
・回転画像リンクのためのrotate.gifをwwwからアクセスできる適当な場所に置いてください。(上記画像用ディレクトリ中が望ましい)パーミッションは0644としてください。
・post2mt.cfgを変更して、あなたの環境に合わせるように設定してください。
・専用メールアドレスに.forwardを設置します。(aliasesでももちろんOk)

"|(/path/to/post2mt.pl /path/to/MT /path/to/post2mt.cfg)"

ここで、
/path/to/post2mt.pl は、post2mt.plが置かれている場所
/path/to/MT はMTのインストールディレクトリパス名
/path/to/post2mt.cfg はpost2mt.cfgが置かれている場所
となります。
※環境設定ファイルpost2mt.cfgはアカウント毎に作成可能です。名前は何でも構いません。


注意点
・セキュリティ対策はまだ為されていません。メールアドレスが知られる事のないようにしてください。


謝辞

・mail2blog には色々と勉強させてもらいました。特にMTについて。

2004年1月 3日

PCメールサンプル

picture



picture



これはサンプルです。

PCメールクライアントから、JPEG, GIF, PNG, PNGの四つの画像を添付して送っ
てます。

大きいものは、自動的にポップアップになってます。
ブラウザでのスケーリングはジャギーですが、手抜きなんで済みません。

au携帯からのサンプル


picture


auからの写真 大きいのと小さいの、二つ添付してます。

2004年1月 2日

iモードからのサンプル

picture


iショットLです。 下に絵文字が入ってますが、これはダメでしょう。

〓〓〓

post2mt.pl 「メールからのエントリ」 公開します

post2mt.pl概要

・メール(e-mail, DoCoMo imode mail, ishot mail, au e-mail, photo mail, and maybe vodafone mail, sha-mail)からMovable Type(MT)にエントリできます。
・画像は複数個あれば一つのエントリに全部入れます。
・サポートしているものは、テキストと画像のみです。それ以外のものは取り込みません。
・エントリは、画像があれば画像を先に本文があればその後本文になります。
・サブジェクトは必須でそれがタイトルになり、一つ以上の画像もしくは本文いずれかが必須となります。もちろん両方あっても構いません。
・画像はサイズが(400x400)まではそのままエントリに張り付けます。それを越える画像の場合は、エントリ上はスケールされ、画像をクリックするとpop upウインドウに実サイズで表示します。スケール時は縦横の比率を守ります。

※先にmailbbsを使ったとありますが、一度はそれでやったのですが、美しくなく、結局mailbbsを使うのは断念し、新規に作り直しました。


ダウンロード

最新版をダウンロードしてください。

必要な環境

・専用メールアドレス
・post2mt用blog、カテゴリ、ユーザ(MT) これらは専用でなくても構いません。
・perl 5以上
・Image::Magick
・MIME::Parser
・その他


インストール

・必要な環境を整えます
・post2mt.plのパーミッションは0755にしてください。
・画像用ディレクトリを作ります。パーミッションは0757としてください。
・専用メールアドレスに.forwardを設置します。(aliasesでももちろんOk)

"|(/path/to/post2mt.pl /path/to/MT blogname username catname /path/to/image-dir http://URL/to/image-dir)"

ここで、
/path/to/post2mt.pl は、post2mt.plが置かれている場所
/path/to/MT はMTのインストールディレクトリパス名
blogname はエントリするblogの名前
username はそのblogのユーザ名
catname はエントリするカテゴリ名
/path/to/image-dir は上で作った画像を置くディレクトリパス名
http://URL/to/image-dir は上記ディレクトリへのURL
となります。
※blog名やカテゴリ名に日本語を使う場合はEUCコードとしてください。(コード変換でEUCからと決め打ちしてます=自動検出は短過ぎるとよく間違えますので)
※出力先MTはUTF-8に決め打ちしています。EUCを使っている場合は、適宜プログラム(post2mt.pl)を変更してください。

使い方

・専用メールアドレスにメールを出すと即時にblogが更新(自動ビルド)されます。
・ping設定がされていれば、自動的に更新pingが為されます。
・インデックスに表示される画像の最大は(400x400)になってますが、これを変えるにはpost2mt.plの最初の方に定義されている数字を適宜変更してください。

注意点
・セキュリティ対策はまだ為されていません。メールアドレスが知られる事のないようにしてください。
・カテゴリは設置時に一意になってしまいます。


謝辞
・mail2blog には色々と勉強させてもらいました。特にMTについて。


更新

表示上の画像最大サイズを(400x400)と変更しました。 2004/1/3