https://github.com/uetchy/pupil
The "Lazy" Twitter API Library for Ruby
https://github.com/uetchy/pupil
Last synced: about 2 months ago
JSON representation
The "Lazy" Twitter API Library for Ruby
- Host: GitHub
- URL: https://github.com/uetchy/pupil
- Owner: uetchy
- License: mit
- Created: 2011-12-16T07:49:26.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2014-11-26T11:17:23.000Z (over 11 years ago)
- Last Synced: 2025-02-01T08:04:22.228Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 469 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.ja.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Pupil
=============
Pupil はRuby 1.9.xのための"怠惰"なTwitter APIライブラリです。
フューチャー
-------------
* Pupilは動的なTwitterAPIラッパーであり、APIの突然の仕様変更に柔軟に対応することができます
* Ruby on Railsライクな直感的で書きやすい文法
* 殆どのREST APIをサポートしていますが、一部のAPIはサポートされていません
* Twitter Streaming APIをサポート
* コマンドラインからPupilを自由にテスト出来るEyedropsコマンド
問題
-------------
* 一部のAPIをサポートしていません
* 不安定です
* ドキュメントがありません(誰か書いて!)
動作環境
-------------
* json及びoauth gem
* Ruby 1.9.x
インストール
-------------
gem install pupil
簡単な使用例
-------------
require "pupil"
oauth_key = {
:consumer_key => "something",
:consumer_secret => "something",
:access_token => "something",
:access_token_secret => "something"
}
pupil = Pupil.new(oauth_key)
# リプライが含まれないタイムラインを取得する
pupil.timeline :count => 50, :exclude => :replies
# @twitterapi をフォローする
pupil.follow :twitterapi
# プロフィールのURLをアップデートする
pupil.update_profile :url => "http://oameya.com"
Streaming API を使ってみる
require "pupil/stream"
oauth_key = {
:consumer_key => "something",
:consumer_secret => "something",
:access_token => "something",
:access_token_secret => "something"
}
stream = Pupil::Stream.new oauth_key
# ユーザーストリーム
stream.start :userstream do |status|
if status.event == :retweeted
puts "これはリツイートされた呟きです! => #{status.text}"
end
end
# 検索ストリーム
stream.start :search, :track => "#メリークリスマス" do |status|
puts "メリー・クリスマス、#{status.user.screen_name}!"
end
`oauth_key` を作る
require "pupil/keygen"
keygen = Pupil::Keygen.new
token = keygen.interactive #=> インタラクティブにoauth_keyを生成
Eyedrops, the interactive Pupil
> eyedrops -h
> eyedrops -u [name] -i
eyedrops> twitter.timeline :count => 10
...
協力
-------------
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
クレジット
-------------
開発者: [おおあめ](http://twitter.com/o_ame)
ライセンス
-------------
Copyright (c) 2011 おおあめ. LICENSE を見て詳しい情報を得てください。