Вопрос

I want to get my Weibo (www.weibo.com - china sns) tweet list by api.

I am using https://code.google.com/p/weibo4j/ library.

But their sample source only contains web auth.

If i want to their accessToken, their sample source shows tutorial using web browser.

System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);
Weibo weibo = new Weibo();
RequestToken requestToken = weibo.getOAuthRequestToken();
...
BareBonesBrowserLaunch.openURL(requestToken.getAuthorizationURL());

I want to login weibo api using my account directly and get my timeline post list.

But I think their document does not contain this method. Is anybody already resolved its problem?

So i want to code library for using weibo api as below code.

Weibo weibo = new Weibo();
weibo.setUserAndPassword('john', 'johnpassword'); // weibo4j does not support this method.
....
Paging pag = new Paging();
pag.setSinceId(3343021761165196l);
pag.setCount(200);
List<Status> statuses = weibo.getUserTimeline("john", pag);

Is there any java library for using weibo api?

Это было полезно?

Решение

I think there aren't any library can get weibo timeline via plaint username and password!

A short history: Weibo api has two version, namely V1 and V2. In V1 version api, they actually support this kind of login, check this example. However, after V2 version api was created, all app must use oauth2.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top