PostTweet プラグインのインストール

Debian TS-WXL

現在使わせていただいている MovableType用PostToTwitterプラグイン の後継、 MovableType用PostTweetプラグイン がリリースされていた。

早速使わせていただく。
私にとっての目玉は「指定日投稿でも投稿します」。

ダウンロード

http://labs.m-logic.jp/plugins/posttweet/PostTweet-1.0.1.tar.gz を いただく
yasunari@tswxl:~$ cd /tmp
yasunari@tswxl:/tmp$ wget http://labs.m-logic.jp/plugins/posttweet/PostTweet-1.0.1.tar.gz
--2010-06-22 18:39:15--  http://labs.m-logic.jp/plugins/posttweet/PostTweet-1.0.1.tar.gz
Resolving labs.m-logic.jp... 210.143.136.41
Connecting to labs.m-logic.jp|210.143.136.41|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 130938 (128K) [application/x-gzip]
Saving to: `PostTweet-1.0.1.tar.gz'

100%[========================================================================================================>] 130,938     --.-K/s   in 0.09s

2010-06-22 18:39:16 (1.42 MB/s) - `PostTweet-1.0.1.tar.gz' saved [130938/130938]

yasunari@tswxl:/tmp$

セットアップ

PostTweetプラグイン ドキュメント にしたがってセットアップを進める

インストール

展開

yasunari@tswxl:/tmp$ tar ztvf PostTweet-1.0.1.tar.gz
drwxrwxrwx 0/0               0 2010-06-21 12:47 PostTweet/
drwxrwxrwx 0/0               0 2010-06-21 12:47 PostTweet/docs/
-rwxrwxrwx 0/0            4368 2010-05-19 17:43 PostTweet/docs/info1.png
-rwxrwxrwx 0/0            4281 2010-05-19 17:43 PostTweet/docs/info2.png
-rwxrwxrwx 0/0            9065 2010-05-19 17:43 PostTweet/docs/moduleerror.png
-rwxrwxrwx 0/0            1143 2010-05-19 17:43 PostTweet/docs/mtdocs.css
-rwxrwxrwx 0/0           26186 2010-06-19 23:05 PostTweet/docs/posttweet.html
-rwxrwxrwx 0/0            4130 2010-05-19 17:43 PostTweet/docs/preview.png
-rwxrwxrwx 0/0            5378 2010-05-19 17:43 PostTweet/docs/setting1.png
-rwxrwxrwx 0/0            3990 2010-05-19 17:43 PostTweet/docs/setting10.png
-rwxrwxrwx 0/0            1404 2010-05-19 17:55 PostTweet/docs/setting11.png
-rwxrwxrwx 0/0            7735 2010-05-19 17:43 PostTweet/docs/setting2.png
-rwxrwxrwx 0/0            8433 2010-05-19 17:43 PostTweet/docs/setting3.png
-rwxrwxrwx 0/0            7810 2010-05-19 17:43 PostTweet/docs/setting4.png
-rwxrwxrwx 0/0            5163 2010-05-19 17:43 PostTweet/docs/setting5.png
-rwxrwxrwx 0/0            1576 2010-05-19 17:43 PostTweet/docs/setting6.png
-rwxrwxrwx 0/0            2495 2010-05-19 17:43 PostTweet/docs/setting7.png
-rwxrwxrwx 0/0            1862 2010-05-19 17:43 PostTweet/docs/setting8.png
-rwxrwxrwx 0/0            5463 2010-05-19 17:43 PostTweet/docs/setting9.png
-rwxrwxrwx 0/0           20001 2010-05-19 17:43 PostTweet/docs/twitter1.png
-rwxrwxrwx 0/0           14101 2010-05-19 17:43 PostTweet/docs/twitter2.png
drwxrwxrwx 0/0               0 2010-06-21 12:47 PostTweet/plugins/
drwxrwxrwx 0/0               0 2010-06-21 12:47 PostTweet/plugins/PostTweet/
drwxrwxrwx 0/0               0 2010-06-21 12:47 PostTweet/plugins/PostTweet/extlib/
	:
ディレクトリ構造が、そのまま展開はできないようなので、 まずは /tmp に展開する
yasunari@tswxl:/tmp$ ^ztvf^zxvf
tar zxvf PostTweet-1.0.1.tar.gz
PostTweet/
PostTweet/docs/
PostTweet/docs/info1.png
PostTweet/docs/info2.png
PostTweet/docs/moduleerror.png
PostTweet/docs/mtdocs.css
PostTweet/docs/posttweet.html
PostTweet/docs/preview.png
PostTweet/docs/setting1.png
PostTweet/docs/setting10.png
PostTweet/docs/setting11.png
PostTweet/docs/setting2.png
PostTweet/docs/setting3.png
PostTweet/docs/setting4.png
PostTweet/docs/setting5.png
PostTweet/docs/setting6.png
PostTweet/docs/setting7.png
PostTweet/docs/setting8.png
PostTweet/docs/setting9.png
PostTweet/docs/twitter1.png
PostTweet/docs/twitter2.png
PostTweet/plugins/
PostTweet/plugins/PostTweet/
PostTweet/plugins/PostTweet/extlib/
PostTweet/plugins/PostTweet/extlib/Digest/
	:
	:

移動

PostTweet/plugins/PostTweet を (Movable Typeインストールディレクトリ)/plugins に移動すれば良いようなので、移動
yasunari@tswxl:(Movable Typeインストールディレクトリ)/plugins$ mv /tmp/PostTweet/plugins/PostTweet .
yasunari@tswxl:(Movable Typeインストールディレクトリ)/plugins$
「(Movable Typeインストールディレクトリ)」は伏せ字のつもり

アカウントの登録

ブログ/サイトのプラグイン設定画面で、PostTweet の設定を表示する。

見事

お使いのサーバーで必要なモジュールを読み込めません : Crypt::SSLeay もしくは IO::Socket::SSL, Digest::SHA1
が出る。

perl モジュールのインストール

どうやるんだ??

ごぞごそ
dh-make-perl で作るらしい
やってみる

tswxl:~# dh-make-perl --build --cpan Digest::SHA1
-su: dh-make-perl: command not found
tswxl:~#
パッケージを探す
tswxl:~# apt-cache search dh-make-perl
dh-make-perl - Create Debian packages from perl modules
libclass-accessor-chained-perl - make chained accessors
libclass-csv-perl - Class based CSV parser/writer
libhash-merge-perl - Merges arbitrarily deep hashes into a single hash
libmodule-depends-perl - identify the dependencies of a distribution
libperlio-via-dynamic-perl - dynamic PerlIO layers
libregexp-assemble-perl - Assemble multiple Regular Expressions into a single RE
tswxl:~#
そのままストレートに dh-make-perl
tswxl:~# apt-get install !$
apt-get install dh-make-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  apt-file build-essential bzip2 cpp cpp-4.3 debhelper dpkg-dev fakeroot g++ g++-4.3 gcc gcc-4.3 gettext gettext-base html2text intltool-debian
  libapt-pkg-perl libc6 libc6-dev libclass-accessor-chained-perl libclass-accessor-perl libcompress-raw-zlib-perl libcompress-zlib-perl
  libconfig-file-perl libdigest-hmac-perl libdigest-sha1-perl libemail-date-format-perl libfile-chdir-perl libfile-remove-perl libfont-afm-perl
  libgmp3c2 libgomp1 libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libio-compress-base-perl
  libio-compress-zlib-perl libio-socket-ssl-perl libio-stringy-perl liblist-moreutils-perl libmail-box-perl libmail-sendmail-perl
  libmailtools-perl libmime-types-perl libmodule-depends-perl libmpfr1ldbl libnet-libidn-perl libnet-ssleay-perl libobject-realize-later-perl
  libstdc++6-4.3-dev libsys-hostname-long-perl libtimedate-perl liburi-perl libuser-identity-perl libwww-mechanize-perl libwww-perl libyaml-perl
  linux-libc-dev make menu patch po-debconf
Suggested packages:
  openssh-client sudo bzip2-doc cpp-doc gcc-4.3-locales dh-make debian-keyring gcc-4.3-doc libstdc++6-4.3-dbg gcc-multilib manpages-dev autoconf
  automake1.9 libtool flex bison gdb gcc-doc libmudflap0-4.3-dev libgcc1-dbg libgomp1-dbg libmudflap0-dbg cvs gettext-doc glibc-doc
  libmime-tools-perl spamassassin libmail-imapclient-perl libstdc++6-4.3-doc make-doc gksu kdebase-bin kdebase-runtime ktsuss sux diff-doc
The following NEW packages will be installed:
  apt-file build-essential bzip2 cpp cpp-4.3 debhelper dh-make-perl dpkg-dev fakeroot g++ g++-4.3 gcc gcc-4.3 gettext gettext-base html2text
  intltool-debian libapt-pkg-perl libc6-dev libclass-accessor-chained-perl libclass-accessor-perl libcompress-raw-zlib-perl
  libcompress-zlib-perl libconfig-file-perl libdigest-hmac-perl libdigest-sha1-perl libemail-date-format-perl libfile-chdir-perl
  libfile-remove-perl libfont-afm-perl libgmp3c2 libgomp1 libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl
  libio-compress-base-perl libio-compress-zlib-perl libio-socket-ssl-perl libio-stringy-perl liblist-moreutils-perl libmail-box-perl
  libmail-sendmail-perl libmailtools-perl libmime-types-perl libmodule-depends-perl libmpfr1ldbl libnet-libidn-perl libnet-ssleay-perl
  libobject-realize-later-perl libstdc++6-4.3-dev libsys-hostname-long-perl libtimedate-perl liburi-perl libuser-identity-perl
  libwww-mechanize-perl libwww-perl libyaml-perl linux-libc-dev make menu patch po-debconf
The following packages will be upgraded:
  libc6
1 upgraded, 63 newly installed, 0 to remove and 1 not upgraded.
Need to get 25.9MB of archives.
After this operation, 70.2MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org lenny/main gettext-base 0.17-4 [119kB]
	:
	:
Setting up menu (2.1.41) ...
Setting up libstdc++6-4.3-dev (4.3.2-1.1) ...
Setting up g++-4.3 (4.3.2-1.1) ...
Setting up g++ (4:4.3.2-2) ...
Setting up build-essential (11.4) ...
Processing triggers for menu ...
tswxl:~#
大量にインストールされた。

Digest::SHA1 の作成

tswxl:~# dh-make-perl --build --cpan Digest::SHA1
Dispatching deprecated method 'CPAN::Config::load' to CPAN::HandleConfig


CPAN is the world-wide archive of perl resources. It consists of about
300 sites that all replicate the same contents around the globe. Many
countries have at least one CPAN site already. The resources found on
CPAN are easily accessible with the CPAN.pm module. If you want to use
CPAN.pm, lots of things have to be configured. Fortunately, most of
them can be determined automatically. If you prefer the automatic
configuration, answer 'yes' below.

If you prefer to enter a dialog instead, you can answer 'no' to this
question and I'll let you configure in small steps one thing after the
other. (Note: you can revisit this dialog anytime later by typing 'o
conf init' at the cpan prompt.)
Would you like me to configure as much as possible automatically? [yes]
	:
	:
dh_md5sums
dh_builddeb
dpkg-deb: building package `libdigest-sha1-perl' in `../libdigest-sha1-perl_2.12-1_armel.deb'.
make: Leaving directory `/root/Digest-SHA1-2.12'
Done
tswxl:~# ls
Digest-SHA1-2.12  libdigest-sha1-perl_2.12-1_armel.deb  libdigest-sha1-perl_2.12.orig.tar.gz
tswxl:~#

Crypt::SSLeay の作成

tswxl:~# dh-make-perl --build --cpan Crypt::SSLeay
Dispatching deprecated method 'CPAN::Config::load' to CPAN::HandleConfig
CPAN: Storable loaded ok (v2.18)
Going to read /root/.cpan/Metadata
	:
	:
========================================================================
No installed SSL libraries found in any of the following places.
    /local
    /local/ssl
    /opt/ssl
    /usr
    /usr/local
    /usr/local/ssl
    /usr/local/openssl
You will have to either specify a directory location at the following
prompt, or rerun the Makefile.PL program and use the --lib switch
to specify the path. If the path in question is considered standard
on your platform, please consider filing a bug report in order to
have it taken into account in a subsequent version of Crypt::SSLeay.


This host looks like it is running Debian. Crypt::SSLeay needs to
be compiled with C headers that the libssl-dev package makes
available. Please install that package before trying to build this
module. (You can always deinstall the package afterwards, once
Crypt::SSLeay has been built).
Which SSL install path do you want to use?
======================================================================
First attempt (Module::Depends::Intrusive) at a dependency
check failed. Possible use of Module::Install ?
Trying again with Module::Depends ...
======================================================================
======================================================================
Could not find the dependencies for the requested module.
Generated error: Can't use an undefined value as a HASH reference at /usr/bin/dh-make-perl line 723.
Please check if your module depends on Module::Install
for its build process - Automatically finding its
dependencies is unsupported, please specify them manually
using the 'depends' option.
Alternatively, including a META.yml file with dependencies
should allow discovery even for Module::Install modules.
======================================================================
tswxl:~#
何か、パッケージが足りない。

IO::Socket::SSL を作ってみる

代りに IO::Socket::SSL を作ってみる
tswxl:~# dh-make-perl --build --cpan IO::Socket::SSL
Dispatching deprecated method 'CPAN::Config::load' to CPAN::HandleConfig
CPAN: Storable loaded ok (v2.18)
Going to read /root/.cpan/Metadata
  Database was generated on Tue, 22 Jun 2010 09:27:07 GMT
	:
	:
dh_md5sums
dh_builddeb
dpkg-deb: building package `libio-socket-ssl-perl' in `../libio-socket-ssl-perl_1.33-1_all.deb'.
make: Leaving directory `/root/IO-Socket-SSL-1.33'
Done
tswxl:~# ls
Crypt-SSLeay-0.57  IO-Socket-SSL-1.33                     libdigest-sha1-perl_2.12-1_armel.deb  libio-socket-ssl-perl_1.33-1_all.deb
Digest-SHA1-2.12   libcrypt-ssleay-perl_0.57.orig.tar.gz  libdigest-sha1-perl_2.12.orig.tar.gz  libio-socket-ssl-perl_1.33.orig.tar.gz
tswxl:~#
こちらはできた。

perl もジュールのインストール

tswxl:~# ls *.deb
libdigest-sha1-perl_2.12-1_armel.deb  libio-socket-ssl-perl_1.33-1_all.deb
tswxl:~# dpkg -i *.deb
(Reading database ... 18752 files and directories currently installed.)
Preparing to replace libdigest-sha1-perl 2.11-2+b1 (using libdigest-sha1-perl_2.12-1_armel.deb) ...
Unpacking replacement libdigest-sha1-perl ...
Preparing to replace libio-socket-ssl-perl 1.16-1+lenny1 (using libio-socket-ssl-perl_1.33-1_all.deb) ...
Unpacking replacement libio-socket-ssl-perl ...
Setting up libdigest-sha1-perl (2.12-1) ...
Setting up libio-socket-ssl-perl (1.33-1) ...
Processing triggers for man-db ...
tswxl:~#
こんなんで、いいのかぁ???

アカウントの登録:再

もう一度 ブログ/サイトのプラグイン設定画面で、PostTweet の設定を表示する。

見事「OAuthによる認証」が表示された

「OAuthによる認証」をクリック
PIN 番号を入手して、OAuthによる認証を実行。
見事に OAuth による認証が完了した。

確認

新規の記事を投稿して確認。

続いて指定日投稿をして確認

Good going !



TS-WXL
楽天市場
amazon
Yahoo ショッピング
Livedoor デパート


ファン
ハックの記録
LinkStation/玄箱 をハックしよう

iptables

Copyright (C) 2003-2010 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市