基本的Twitter客户端 [英] Basic twitter client

查看:145
本文介绍了基本的Twitter客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立一个基本的Twitter客户端,它能够读取/更新/发送鸣叫,也通过朋友鸣叫和哈希标签搜索。到目前为止,我的应用程序可以登录并发出鸣叫在墙上。但我不知道特别是阅读的休息和更新微博的想法。任何信息将是非常有益的。感谢的很多..

I am trying to develop a basic twitter client which is able to read/update/send tweets and also searching through friends tweet and hash tagging. So far my app can login and send tweets to the wall. But i have no idea about the rest especially read and update tweets. Any information would be very helpful. Thank's a lot..

推荐答案

添加Twitter4J库到您的构建路径后。

After adding Twitter4J library to your build path.

要阅读的鸣叫和发送messges不喜欢,
从你的身份验证令牌和密钥检索你的Twitter做对象,

To read tweets and send messges do like, From your Auth Token and Key you retrieved make Twitter object,

ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setOAuthConsumerKey(Constants.CONSUMER_KEY);
cb.setOAuthConsumerSecret(Constants.CONSUMER_SECRET);
cb.setOAuthAccessToken(token);
cb.setOAuthAccessTokenSecret(secret);
cb.setIncludeEntitiesEnabled(true);
TwitterFactory factory = new TwitterFactory(cb.build());
Twitter twitter = factory.getInstance();

使用这个微博的对象,你可以得到时间轴,提及和发送类似directMessages ..

Using this twitter object you can get Timelines,Mentions and send directMessages like..

twitter.getUserTimeline();
twitter.sendDirectMessage(screenName, text);
twitter.getMentions();

我建议你去这个链接首先,

I suggest you to go to this links first,

1)链接 Twitter4J罐子 文件

1) Link for Twitter4J jar file

2)链接 code例子 作为Twitter4J

2) Link for Code Examples for Twitter4J

3)和 的JavaDoc 作为Twitter4J阿比

3) and JavaDoc for Twitter4J Api

这篇关于基本的Twitter客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆