twitter4j

Twitter4j: Get list of replies for a certain tweet

﹥>﹥吖頭↗ 提交于 2019-11-28 22:07:43
Is it possible to get a list of tweets that reply to a tweet (or to its replies) using twitter4j? The twitter website and Android app have this feature. Bozho Here's a code I'm using in welshare The first part gets all the tweets that twitter is displaying below the tweet, when it is opened. The rest takes care of conversations, in case the tweet is a reply to some other tweet. RelatedResults results = t.getRelatedResults(tweetId); List<Status> conversations = results.getTweetsWithConversation(); ///////// Status originalStatus = t.showStatus(tweetId); if (conversations.isEmpty()) {

Flume HDFS sink keeps rolling small files

≯℡__Kan透↙ 提交于 2019-11-28 10:25:23
问题 I'm trying to stream twitter data into hdfs using flume and this: https://github.com/cloudera/cdh-twitter-example/ Whatever I try here, it keeps creating files in HDFS that range in size from 1.5kB to 15kB where I would like to see large files (64Mb). Here is the agent configuration: TwitterAgent.sources = Twitter TwitterAgent.channels = MemChannel TwitterAgent.sinks = HDFS TwitterAgent.sources.Twitter.type = com.cloudera.flume.source.TwitterSource TwitterAgent.sources.Twitter.channels =

Is it possible to get more than 100 tweets?

删除回忆录丶 提交于 2019-11-28 08:25:57
Is it possible to get more than 100 tweets using the Twitter4j API? If so can anyone point out the way to do so?? Would need to see your code to provide a code example specific to your case, but you can do this through since_id or max_id . This information is for the Twitter API. To get the previous 100 tweets: find the the lowest id in the set that you just retrieved with your query perform the same query with the max_id option set to the id you just found. To get the next 100 tweets: find the the highest id in the set that you just retrieved with your query perform the same query with the

Retrieve the user profile image from twitter

前提是你 提交于 2019-11-28 07:46:51
I am using the Twitter4J API in Java to retrieve the profile image for a Twitter user whose logged in. The command is something like : twitter.getProfileImage(twitter.getScreenName(), Imagesize); What is the image size? How can I display the ProfileImage object in a label for example? ok, the answer is : Assume that the Twitter object is twitter 1 - get the user from the twitter object User user = twitter.showUser(twitter.getid()); 2 - get the profile image URL URL url = user.getProfileImageURL(); 3 - create Image icon ImageIcon img = new ImageIcon(url); 4 - set the JLabel icon to be the

Android Twitter xAuth example using twitter4j

六眼飞鱼酱① 提交于 2019-11-28 06:38:49
Android: I am trying the following xAuth example for android share. xAuth Authentication for Twitter Share in Android? System.setProperty("twitter4j.oauth.consumerKey", "your token"); System.setProperty("twitter4j.oauth.consumerSecret", "your token secret"); Twitter twitter = new TwitterFactory().getInstance(login, password); AccessToken accessToken = twitter.getOAuthAccessToken(); //Then you must save your Token and Token secret from AccesToken if (mAccessToken != null) { if (mAccessToken.getToken() != null && mAccessToken.getTokenSecret() != null) { saveAccessToken(mAccessToken.getToken(),

Android, Twitter, 'FOLLOW US'

无人久伴 提交于 2019-11-28 05:30:51
问题 I am building an android application and I am stuck at one place. I have integrated Twitter in my app using twitter4j, signpost apis. I am successful in writing code for putting text in user profile but I also want the user to follow my app when they click 'follow us on twitter' button. Can anybody give me reference or guidance of writing such code? 回答1: What you are probably looking for is createFriendship() You can see how it is used here 2016 Edit: Google code svn is broken and twitter 4j

Android twitter4j upload image

久未见 提交于 2019-11-28 04:47:16
I have an android app through which I can successfully update the twitter status. I am using it to share links to a webpage which displays an image. I think it will be nice to have a scaled down preview of the image along with the tweet the same way instagram does. How do I upload this image along with my tweet? I had the same requirement sometimes back and finally come with the function may be it will help you too. /** * To upload a picture with some piece of text. * * * @param file The file which we want to share with our tweet * @param message Message to display with picture * @param

Android: Login with Twitter using Twitter4J

我与影子孤独终老i 提交于 2019-11-27 19:12:05
What I Have Tried: I already have registered an app in twitter and got Consumer Key and Secret.Even I got various codes to login with twitter.These are what I have tried from: http://thetechnib.blogspot.com/2011/01/android-sign-in-with-twitter.html [This link is dead, you may view an archive here ] http://www.android10.org/index.php/articleslibraries/291-twitter-integration-in-your-android-application Problem I have: Till now,above code takes me to twitter login and let me sign in and have a PIN to complete the login process.But I have no idea how to use it to get my app working.I checked the

android twitter retrieveRequestToken 401 on request token

半世苍凉 提交于 2019-11-27 17:46:47
问题 I am trying the following sample app for twitter oauth. http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html private void askOAuth() { try { consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET); provider = new DefaultOAuthProvider("http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token", "http://twitter.com/oauth/authorize"); String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL); Toast.makeText(this, "Please

android twitter4j authentication via installed twitter app not browser

百般思念 提交于 2019-11-27 16:24:57
问题 i am using twitter4j in my android application to post status to twitter like in this example: http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/ All is working good but the question is: The authentication is done via browser .. is there any way to detect if twitter app already installed on mobile and authenticate via it ? Thanks. 回答1: EDITED: November 27, 2014 Twitter recently released Fabric that does include SSO support. From the Android docs: When attempting to