2009/04/16

はてなブックマークをdeliciousに同期する場合、どうやってますか?
  • 同時ポストツール?
  • Plagger?
  • まさか、手作業?
同時ポストツールの場合、確かにその場で同時にポスト出来て便利ですね。でも携帯ではてなブックマークから登録した場合、同期されませんよね。 Plaggerだと、cronで動き続けるPCが要りますよね。家に24時間稼動可能なPC無いよ!なんて人いるかもしれません。
手作業?問題外!

先日、Google App Engineにcronが導入されました。
Google App Engine Blog: Seriously this time, the new language on App Engine: Java™

Cron support: schedule tasks like report generation or DB clean-up at an interval of your choosing.

http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html
つまり...
  1. cronでイベント発生
  2. はてなブックマークからRSS取得
  3. 内部のデータベースから既にポスト済みでないか確認
  4. deliciousにポストする
  5. モテモテ
って事で作ってみました。
mattn's hatenabookmark-meets-delicious at master - GitHub

post hatenabookmark to delicious periodically using google app engine

http://github.com/mattn/hatenabookmark-meets-delicious/tree/master
Google App Engineのアカウントを作成後アプリケーションを作成します。
app.yamlの application: your_app_name
version: 1
runtime: python
api_version: 1

handlers:
  - url: /tasks/sbm-sync
    script: sbm-sync.py

  - url: /
    script: sbm-sync.py

  - url: /favicon.ico
    static_files: static/images/favicon.ico
    upload: static/images/favicon.ico
    mime_type: image/x-icon

  - url: /static
    static_dir: static
your_app_nameの部分を作成したアプリケーションIDに書き換えて下さい。次にmy-config.yaml.exampleをmy-config.yamlにコピーし hatena_user : your_hatena_user
delicious_user : your_delicious_user
delicious_pass : your_delicious_password
timezone: JST
timeoffset: 9
あなたの、はてなブックマークIDとdeliciousユーザID/パスワードに書き換えて下さい。
あとはサーバにアップロードすれば10分毎に、はてなブックマークのRSSを取得してdeliciousに同期されます。
gae-sbm-sync

よろしければ使ってみて下さい。ソースはgithubにあるのでpatch welcomeです。
Posted at 14:09 | WriteBacks () | Edit
Edit this entry...

wikieditish message: Ready to edit this entry.






















A quick preview will be rendered here when you click "Preview" button.