Posted by & filed under OS X.

そう言えばOAuth以降、GeekToolを使ってTwitterをデスクトップに表示出来なくなっていたので、Geekletsで紹介されているPython Twitter toolsを使って表示させてみる。

先ずsetuptoolsが要るって事なんだけど手元には明示的に入れた覚えは無い^^;;;
py26-distributeがたまたま入っているのでいきなり。

% sudo easy_install twitter
Searching for twitter
Reading http://pypi.python.org/simple/twitter/
Reading http://mike.verdone.ca/twitter/
Best match: twitter 1.4.2
Downloading http://pypi.python.org/packages/2.6/t/twitter/twitter-1.4.2-py2.6.egg#md5=7a0b619d830cb310d65fc1f19fe3dd91
Processing twitter-1.4.2-py2.6.egg
Moving twitter-1.4.2-py2.6.egg to /Library/Python/2.6/site-packages
Adding twitter 1.4.2 to easy-install.pth file
Installing twitter script to /usr/local/bin
Installing twitterbot script to /usr/local/bin

Installed /Library/Python/2.6/site-packages/twitter-1.4.2-py2.6.egg
Processing dependencies for twitter
Finished processing dependencies for twitter

以上。あぁそんな所に…みたいな。

% /usr/local/bin/twitter -h
Hi there! We're gonna get you all set up to use the Command-Line Tool.

In the web browser window that opens please choose to Allow
access. Copy the PIN number that appears on the next page and paste or
type it here:

Please enter the PIN: XXXXXXX

That's it! Your authorization keys have been written to /Users/HOGE/.twitter_oauth.

USAGE:

 twitter [action] [options]
<snip>

コマンドを実行すると
http://api.twitter.com/oauth/authorize?oauth_token=HOGEhoge
がブラウザで開かれるので、許可してあげると、数字が表示されるのでそれを入力するとホームディレクトリーに
.twitter_oauth
ファイルを作って格納してくれると。

GeekletsページからTwitter1.gletをダウンロードしたら、いきなりダブルクリックしてGeekToolに登録するも良し、サラッと中を見てそんな↓オプションを指定しているのね、と納得するも良し。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Command</key>
        <string>/usr/local/bin/twitter friends --oauth ~/.twitter_oauth -td -f default | tail -5</string>
        <key>DropShadow</key>
        <false/>

-f ansi オプションは | tail … に喰われちゃって惜しいケド、
Yes, swell !.

Popularity: 20%

Leave a Reply

  • (will not be published)