twitter4j

Whether to choose Search or Streaming API of Twitter for public geo-tweets?

老子叫甜甜 提交于 2019-12-10 21:40:25
问题 I want to develop an Android app that will fetch geo-tagged tweets from Twitter public timeline based on user's (current/specified) location. I will have a refresh button and more tweets (custom size of 30 max) will be fetched if available in that particular time. So which API is suitable for this case? Search API or Streaming API. I will use Twitter4J library. 回答1: The streaming API requires that you keep the connection active. This requires a server process with an infinite loop, to get the

Twitter 4j No authentication challenges found, Relevant discussions can be found at internet Exception

半世苍凉 提交于 2019-12-10 21:02:17
问题 I am using twitter4j , i am able to login successfully into my twitter account, but when i am trying to post some thing the following exception is raised. My Code try { Bitmap bmpFinal = getBitmapFromURL(Imagename.trim()); Log.d("ImagePath",Imagename); Configuration conf = new ConfigurationBuilder() .setOAuthConsumerKey(TWITTER_CONSUMER_KEY) .setOAuthConsumerSecret(TWITTER_CONSUMER_SECRET) .setOAuthAccessToken(access_token) .setOAuthAccessTokenSecret(access_token_secret)

“SSL is required” exception while requesting OAuthRequest Token using Twitter4J library

ぐ巨炮叔叔 提交于 2019-12-10 17:45:37
问题 I was trying this sample application provided here, I am getting "SSL is required" exception in this particular piece of code private void askOAuth() { ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); configurationBuilder.setOAuthConsumerKey(Const.CONSUMER_KEY); configurationBuilder.setOAuthConsumerSecret(Const.CONSUMER_SECRET); Configuration configuration = configurationBuilder.build(); twitter = new TwitterFactory(configuration).getInstance(); try { requestToken =

Cannot run Flume because of JAR conflict

Deadly 提交于 2019-12-10 17:32:37
问题 I've installed Flume and Hadoop manually (I mean, not CDH) and I'm trying to run the twitter example from Cloudera. In the apache-flume-1.5.0-SNAPSHOT-bin directory, I start the agent with the following command: bin/flume-ng agent -c conf -f conf/twitter.conf -Dflume.root.logger=DEBUG,console -n TwitterAgent My conf/twitter.conf file uses the logger as the sink. The conf/flume-env.sh assigns to CLASSPATH the flume-sources-1.0-SNAPSHOT.jar that contains the definition of the twitter source.

Twitter API: post on behalf of whom?

送分小仙女□ 提交于 2019-12-10 17:19:06
问题 I want to use Twitter API so my program can post some tweets. To use it I have to register application in dev-center and get some parameters like "Consumer key", "Consumer secret" etc. Then I can use either REST API, or some libraries like twitter4j - OK, that's simple. But the question is: who will be the "author" of such tweets? Or, in other words, where can I find them after posting? Will they be posted by application or by some user? I can't really figure out how particular user binds to

android twitter 4j integration get tweet entities

谁都会走 提交于 2019-12-10 15:39:48
问题 I am working on twitter integration with android using Twiitter4j. I am trying to fetch Home timelines and its working fine. But when i am looking to get urls included in the tweets there is no functions. Is there a functon to get tweet entites like urls etc. Here is the code cb = new ConfigurationBuilder(); cb.setDebugEnabled(true).setOAuthConsumerKey(Constants.CONSUMER_KEY) .setOAuthConsumerSecret(Constants.CONSUMER_SECRET) .setOAuthAccessToken(accessToken).setOAuthAccessTokenSecret(

Twitter4j - Rate limit exceeded

此生再无相见时 提交于 2019-12-10 13:55:57
问题 I would like to get followers using getFollowersIds() in Twitter4j, but I get ConnectionErrorException ... rate limit exceeded public static void main(String[] args) { try { Twitter twitter = TwitterFactory.getSingleton(); String[] srch = new String[]{"TechCrunch"}; ResponseList<User> users = twitter.lookupUsers(srch); for (User user : users) { UserHarvest us = new UserHarvest(6017542); us.getFollowersIds(); try { us.getContributors(); } catch (ConnectionErrorException ex) { Logger.getLogger

Problem in Oauth with twitter4j

对着背影说爱祢 提交于 2019-12-10 10:48:40
问题 This is what I'm getting while calling twitter.getOauthRequestToken(callbackUrl) . I've added the correct consumer key and consumer secret. 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync. <?xml version="1.0" encoding="UTF-8"?> <hash> <error>Desktop applications only support the oauth_callback value 'oob'</error> <request>/oauth/request_token<

Could not find class 'twitter4j.http.AccessToken'

折月煮酒 提交于 2019-12-10 10:45:37
问题 I use twitter4j library to make somethings with twitter. But i have a problem about AccesToken class. I checked my libraries, there is only one AccesToken class and it is in twitter4j.http There are no other AccesToken class. My code was working about 10 hours ago, but now it doesn't work. I am about to go mad :/ Here is my log trace: 04-24 15:53:32.767: E/dalvikvm(305): Could not find class 'twitter4j.http.AccessToken', referenced from method com.twitterresim.TwitterOnay.isAuthenticated 04

Go back after call Intent.ACTION_VIEW in android

三世轮回 提交于 2019-12-09 12:53:52
问题 My app has 3 activity A, B, C. Activity A calls B. In B, I call Intent.ACTION_VIEW to do authentication with Twitter as below: public static void DoAuthen(Context context, String CallBackUrl) throws OAuthMessageSignerException, OAuthNotAuthorizedException, OAuthExpectationFailedException, OAuthCommunicationException { httpOauthConsumer = new CommonsHttpOAuthConsumer(context.getString(R.string.Twitter_ConsumerKey), context .getString(R.string.Twitter_ConsumerSecret)); httpOauthprovider = new