Raindrop 動かしてみた。

Mac OS X Snow Leopard です。隣でOSCデモ用の普通のLeopardにもいれていてほとんど同じ手順。

準備

hg でダウンロードするのでその準備。日本語環境だとX-MAC-JAPANESEなんてエンコーディングは知らん、といわれるので、hgコマンドを hg --encoding=utf-8 となるようにしておく。

$ sudo port install mercurial
$ echo 'alias hg="hg --encoding=utf-8"' >> /.bash_profile
$ . ~/.bash_profile

でダウンロード。

$ hg clone -r 0.1 http://hg.mozilla.org/labs/raindrop

インストール

server/python/check-raindrop.py というのがあるのでそれを使う。必要なモジュールをチェックしてくれるほか --configure をつけると自動的にeasy_installしてくれる。なので、sudo で実行。
こんな感じでいろいろ入ります。

$ sudo ./server/python/check-raindrop.py --configure
Password:
module 'twisted>=8.2' is missing - attempting easy-install
Searching for twisted>=8.2
Reading http://pypi.python.org/simple/twisted/
Reading http://twistedmatrix.com/
Reading http://www.twistedmatrix.com
Reading http://twistedmatrix.com/products/download
Reading http://twistedmatrix.com/projects/core/
Best match: Twisted 8.2.0
Downloading http://tmrc.mit.edu/mirror/twisted/Twisted/8.2/Twisted-8.2.0.tar.bz2#md5=c85f151999df3ecf04c49a781b4438d2
Processing Twisted-8.2.0.tar.bz2

...

Installed /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/simplejson-2.0.9-py2.6-macosx-10.5-i386.egg
Finished processing dependencies for python-twitter==0.6-devel,>=0.6
The raindrop python environment seems to be OK - checking couchdb
couchdb says 'Welcome'.
raindrop appears configured and ready to run.
Please execute 'run-raindrop.py' to create the database and open the app.

あ、Mac の人はPyOpenSSLは 0.8をいれたほうがよいらしいので、http://sourceforge.net/projects/pyopenssl/ から 0.8 の tar.gz を落として直接easy_installするといいでしょう。Pythonのバージョンが複数はいっている人は注意。

各種サービスの設定

~/.raindrop というファイルに書くようです。将来的にはWebで設定が出来る模様。

amacbook:~ yssk22$ cat .raindrop 
[account-gmail-username]
proto=imap
kind=gmail
username=yssk22@gmail.com
password=xxxxx
ssl=True

[account-twitter-username]
proto=twitter
kind=twitter
username=yssk22
password=xxxxxx

[account-rss-feed]
proto=rss
uri=http://d.hatena.ne.jp/yssk22/rss

実行

server/python/run-raindrop.py というのを実行。

$ ./server/python/run-raindrop.py 
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.5-i386.egg/twisted/internet/_sslverify.py:5: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import itertools, md5
Raindrops keep falling on my head...
INFO:model:Connecting to couchdb at {'host': '127.0.0.1', 'port': 5984, 'name': 'raindrop'}
INFO:model:created new database
INFO:model:Connecting to couchdb at {'host': '127.0.0.1', 'port': 5984, 'name': 'raindrop'}
...
INFO:raindrop.bootstrap:updating dojo...
INFO:raindrop.bootstrap:client files in 'inflowgrid' are different - updating doc
INFO:raindrop.bootstrap:design doc '_design/raindrop!content!all' has changed - updating
INFO:model:important view updates starting.
INFO:model:updated 1 view docs in 1 secs - slowest was 'raindrop!content!all' at 1 secs.
INFO:raindrop.bootstrap:rdconfig.js in 'lib' has changed; updating
Apparently everything is finished - terminating.
raindrops were falling for 0:00:51.664851

おお、raindropというDBが作られるようです。

さらにもう一度。今度は sync-messages --max-age=5days というオプションをつけます。これで、.raindropに登録したサービスのメッセージを片っ端からかき集めてくる。

$ ./run-raindrop.py sync-messages --max-age=5days

で終わったら、http://localhost:5984/raindrop/inflow/index.html にアクセスします。

小さいですが写っているのは送信ボックス(Sent)で、メールもtwitterも全部ここに入るようです。なんかメールボックスのsyncがうまくいったり行かなかったり、とかそんな具合ですが。
あとContactsでtwitterのfollowerの一覧が見られます。gmail のContactsも取ってくるのかな?あと、raindrop上でメッセージを書いて(gmail, twitter等のサービスを切り替えられる!)、syncする、ということも将来的にできそうです。

実際に動いているものを見たい人は今週末のOSC Tokyoで見られると思います

以下のエントリは感想。

いや、だからこれってOpenSocialじゃね?

と思って、raindropのdeveloper group に「OpenSocialと統合しないの?」ときいてみたんですが、、とりあえず知らなさそうなのでやってみようと思います。

必殺レプリケーションを唱えれば、あとはMapReduceで簡単に統合出来ると思います。データは。

アプリケーションはDojoに消えてもらえばやる気が出るんだが。*1

Dojoが。。

重たすぎる。というか手持ちのMacbookでやるとファンが回り出すんだけどw

なんでMozillaのプロジェクトなのにjQueryじゃないんだろう。もしかしてBesepinがDojoベース...?Bespin期待してたのに!

あと、各種ライブラリがDesign Documentじゃなくて普通のドキュメントの添付ファイルになってる。別にいいけど。Bespin とかサーバーサイドでも動くように設計しているはずだから、デザインドキュメントにいれとかないともったいない。

MegaView

Wikiにいろいろ書いてあるけれど、単なるCouchDBのJOINに見える。

ドキュメントが。

こんな感じ。

{
   "_id": "rc!contact.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxI=!rd.ext.core.twitterid-to-common!rd.contact",
   "_rev": "1-b173aa8f5b81df54ed5d924a661be789",
   "rd_key": [
       "contact",
       "ed6500d7-e773-4375-9cb3-e736c4768be5"
   ],
   "name": "yssk22",
   "rd_schema_id": "rd.contact",
   "rd_source": [
       "rc!identity.xxxxxxxxxxxxxxxxxxxxxxxx!proto.twitter!rd.identity.twitter",
       "1-a455b397dfee04a134e987582ed8e322"
   ],
   "rd_ext_id": "rd.ext.core.twitterid-to-common"
}

まだよく分からない。

*1:Firefox + Firebug + Dojo の組で開発すると3−4時間に一回ぐらいFirefoxのプロセスを再起動しなければならないぐらいメモリを消費する。。。