twitter4j

Getting “err” : "E11000 duplicate key error when inserting into mongo using the Java driver

百般思念 提交于 2019-12-29 06:46:09
问题 Exception in thread "main" com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost/127.0.0.1:27017" , "err" : "E11000 duplicate key error index: twitterdb03.LevelAFollowers.$ id dup key: { : ObjectId('52d5636de408652b4853a8fe') }" , "code" : 11000 , "n" : 0 , "connectionId" : 12 , "ok" : 1.0} I'm using mongo 2.11.1 Never had problems with simple write operations in java myMap.put(inid, followersList); myObj.putAll(myMap); myIdMapCollection.insert(myObj); 回答1: I found an answer on

Get Second Level features of social network through Twitter Api

不问归期 提交于 2019-12-25 12:13:08
问题 I am trying to get second level features of my twitter personal network using twitter4j library. When I refer to second level features I mean the followers of my followers, the followees of my followees etc. I've started with my followees first using the following code: try{ twitter = tf.getInstance(); long cursor = -1; IDs ids = twitter.getFriendsIDs(cursor); long[] id = ids.getIDs(); ResponseList<User> users = twitter.lookupUsers(id); } catch (Exception e) { logger.warn("Error {}",e

TwitterException+HTTP response code: 403 for URL: http://api.twitter.com/oauth/request_token

半世苍凉 提交于 2019-12-25 06:55:34
问题 I am trying to login on twitter through the following code. I have checked the Consumer key and Consumer secret they are correct what I am putting in my code. Still I am facing the exception @RequestMapping(value = "/signin", method = RequestMethod.GET) public void signIn(HttpServletRequest request, HttpServletResponse response) throws TwitterException, IOException { ConfigurationBuilder cb = new ConfigurationBuilder(); cb.setDebugEnabled(true).setOAuthConsumerKey("xxx")//xxx=Consumer key

Twitter Application-android

三世轮回 提交于 2019-12-25 04:54:15
问题 I am new to twitter .I like to develope one twitter Application. Can anyone tell me: The methods to be used for replying the tweets. How to retweet with userID in arraylist 回答1: you can use OAuth for your twitter application. You can refer to these links to learn how to make calls using the same Android: Twitter and OAuth anyone? http://www.devx.com/webdev/Article/40511/0/page/1 http://blog.sogeti.com/mobile/2010/03/twitter-oauth-for-android.html http://dev.bostone.us/2009/07/16/android-oauth

Rate limit exceeded with Twitter4j

江枫思渺然 提交于 2019-12-25 04:03:59
问题 I'm using this example for pulling tweets from Twitter. I am getting the error below due to rate limit reached. How do I set the rate? 429:Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limiting in API v1.1.(https://dev.twitter.com/docs/rate-limiting/1.1) message - Rate limit exceeded code - 88 Relevant discussions can be found on the Internet at: http://www.google.co.jp/search?q=506c3b98 or http://www

Exception while trying to tweet using twitter4j

折月煮酒 提交于 2019-12-25 03:32:50
问题 Exception while trying to tweet Twitter Login Error , This Exception occurs after the login is done and activity is recalled. if (uri != null && uri.toString().startsWith(TWITTER_CALLBACK_URL)) { // oAuth verifier Log.d("Inside","inside"); String verifier = uri .getQueryParameter(URL_TWITTER_OAUTH_VERIFIER); try { // Get the access token AccessToken accessToken = twitter.getOAuthAccessToken( requestToken, verifier); // Shared Preferences Editor e = mSharedPreferences.edit(); // After getting

Posting twitter thread using Twitter4j

假如想象 提交于 2019-12-24 21:45:23
问题 I'm trying to figure out how to use Twitter4J to post a tweet thread using Twitter4J. I'm guessing it would be somehow using the StatusUpdate class, but the documentation is a bit sparse. Any pointers? 回答1: You should set inReplyToStatusId as latest posted status id for every tweet coming after first tweet. Default value for inReplyToStatusId is -1. Example: long inReplyToStatusId = -1 int counter = 0 int threadLimit = 5 while (counter < threadLimit){ StatusUpdate statusUpdate = new

twitter4J, jquery, coldfusion integration

こ雲淡風輕ζ 提交于 2019-12-24 20:23:18
问题 I'm using Twitter4j and attempting to obtain and store user's Twitter access tokens to database for later tweeting. I want to do it entirely with jQuery and ajax, silently. I have a cfc with the basic functions necessary. e.g. tHe following jquery calls a cfc function which generates the requestURL and pops open a Twitter auth window. $(".cbLinkTwitter").live("click", function(e) { $.getJSON(cfcRoot + "/twitter.cfc?method=getRequestURL&returnformat=json, {"user_id":user_id}, function(res,code

Spark Program finding Popular HashTags from twiiter

ぐ巨炮叔叔 提交于 2019-12-24 19:04:47
问题 I am trying to run this spark program which will get me the popular hashtags currently on twitter and will only show the top 10 hashtags. I have supplied the twiiter access token, Secret & the Customer Key, Secret via a text File. import org.apache.spark.streaming.StreamingContext import org.apache.spark.streaming.Seconds import org.apache.spark.streaming.twitter.TwitterUtils object PopularHashtags { def setupLogging() = { import org.apache.log4j.{ Level, Logger } val rootLogger = Logger

How to send non-string data across activity

こ雲淡風輕ζ 提交于 2019-12-24 18:41:30
问题 In twitterfragment class I have List<twitter4j.Status> statuses = twitter.getUserTimeline(user); Intent intent = new Intent(getActivity(), twitter_timeline.class); intent.putExtra(twitter_timeline.STATUS_LIST, statuses);// this line giving error if I pass status In twitter_timeline class I want to get the statues I sent from twitter fragment. public class twitter_timeline extends Activity { public static List<twitter4j.Status> STATUS_LIST; @Override protected void onCreate(Bundle