2011-06-27 7 views

答えて

0

を発見していない:

github.comにTwitterClientは、Javaコードの例でありますストリーミングAPIを使用して...それが最も重要なHttpURLはTwitterClient.javaにHttpsURLに変化するニーズ、いくつかの作業を必要とします:

/** 
* Extracts the host and post from the baseurl and constructs an 
* appropriate AuthScope for them for use with HttpClient. 
*/ 
private AuthScope createAuthScope(String baseUrl) throws URIException { 
    //HttpURL url = new HttpURL(baseUrl); 
    HttpsURL url = new HttpsURL(baseUrl); 
    return new AuthScope(url.getHost(), url.getPort()); 
} 

example/Example.javahttps://stream.twitter.com/に変更http://stream.twitter.com/。そして、このようにカール実行

track=#YourHashTag 

:CURLで

java <classpathstuff> example.Example username:password -t #YourHashTag 

track.txtと呼ばれるこのでファイルを作る:http://github.com/gistinc/TwitterClientから

取得TwitterClientあなたはそれをコンパイルした後は、次のように例を実行します...あなたはそれが働いているのを見ることができます:

curl https://stream.twitter.com/1/statuses/filter.json -uusername:password -d @track.txt 

希望彼の助け;-)

関連する問題