-
Notifications
You must be signed in to change notification settings - Fork 0
Twitter package for Go
License
m92o/twitter-go
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
#
# Go言語用 Twitterクライアントパッケージ
#
# Copyright (c) 2009 Kunio Murasawa <kunio.murasawa@gmail.com>
#
名前
twitter (ライブラリファイル名 twitter.a)
作者
Kunio Murasawa <kunio.murasawa@gmail.com>
対応機能
- タイムライン
- puclic_timeline
- friends_timeline
- home_timeline
- user_timeline
- mentions
- ステータス
- show
- update
- destroy
- アカウント
- verify credentials
- rate limit status
- リスト
- lists (index)
- list statuses
- サーチ
- users
取得方法
$ git clone git://github.com/m92o/twitter-go.git twitter-go
インストール方法
$ make install
$GOROOT/pkg/<対応アーキテクチャ>/ にライブラリ twitter.a がインストールされます。
またサンプルプログラム twgoコマンドが $GOBIN にインストールされます。
使い方
- パッケージのインポート
import "twitter"
- 初期化
t := twitter.NewTwitter("USERNAME", "PASSWORD", false)
- 自分のユーザ情報取得
user := t.VerifyCredentials()
- タイムライン取得
statuses, users := t.PublicTimeline()
statuses, users := t.FriendsTimeline(nil)
statuses, users := t.HomeTimeline(nil)
statuses, users := t.UserTimeline(nil)
statuses, users := t.Mentions(nil)
- ステータス
t.Show("メッセージID")
- アップデート(つぶやく)
t.Update("メッセージ")
- 削除
t.Destroy("メッセージID")
- リスト一覧取得
lists := t.GetList(userId)
- リストステータス取得(タイムライン)
statuses, users := t.GetLists(userId, listId, nil)
- ユーザサーチ
users := t.UsersSearch(user, nil)
- リミットステータス
rate := t.RateLimitStatus(false)
サンプルプログラム
src/cmd/twgo.go (twgoコマンド)
- 使い方
設定ファイル「.twgo.conf」にユーザ、パスワードを記述しホームディレクトリに置いてください
- 自分のユーザ情報取得
$ twgo my
- リスト一覧
$ twgo lists USER
--- USER には ユーザID 又は スクリーン名 を指定
- タイムライン取得
$ twgo public
$ twgo friends
$ twgo user
$ twgo mentions
$ twgo list USER LIST_ID
--- USER には ユーザID 又は スクリーン名 を指定
- アップテート(つぶやく)
$ twgo update "メッセージ"
- ユーザサーチ
$ twgo search ユーザ名
Twitter API Wiki
http://apiwiki.twitter.com/
ライセンス
BSDライセンス
詳細は附属のLICENCEファイルを参照
About
Twitter package for Go
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published