つかいかた
$ ./latw.sh コマンドラインからつぶやきますよ。
usage: sleep seconds
--2010-04-08 11:43:34-- http://twitter.com/statuses/update.xml
twitter.com (twitter.com) をDNSに問いあわせています... 128.242.240.84
twitter.com (twitter.com)|128.242.240.84|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 401 Unauthorized
twitter.com (twitter.com)|128.242.240.84|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 2302 (2.2K) [application/xml]
`update.xml.4' に保存中
100%[=============================================================================>] 2,302 --.-K/s 時間 0s
2010-04-08 11:43:38 (105 MB/s) - `update.xml.4' へ保存完了 [2302/2302]
tweeted >>> コマンドラインからつぶやきますよ。
- あとでつぶやくなら、第二引数に遅延時間(秒)を入れて、バックグランドにまわしてね
$ ./latw.sh 60秒後につぶやくよ。 60 &
[1] 46122
$ --2010-04-08 11:46:23-- http://twitter.com/statuses/update.xml
twitter.com (twitter.com) をDNSに問いあわせています... 168.143.171.84
twitter.com (twitter.com)|168.143.171.84|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 401 Unauthorized
twitter.com (twitter.com)|168.143.171.84|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 2250 (2.2K) [application/xml]
`update.xml.5' に保存中
100%[=============================================================================>] 2,250 --.-K/s 時間 0s
2010-04-08 11:46:25 (102 MB/s) - `update.xml.5' へ保存完了 [2250/2250]
tweeted >>> 60秒後につぶやくよ。
ソースはこんだけ
- 実行権限ください
- USERNAMEとPASSWORDをいれてね
#!/bin/sh
sleep $2
wget -O --keep-session-cookies --http-user=USERNAME --http-password=PASSWORD --post-data="status=$1" http://twitter.com:80/statuses/update.xml > /dev/null 2>&1
echo "tweeted >>> $1"
めんせき
- うちのMacでしかてすとしてません
- linuxならうごくんじゃね?
- えらーしょり?なにそれ。
- クライアントはapiからになるみたい