How can I get Friends/Friend's IDs of my twitter account using Twitter API?
In this tutorial https://github.com/bengottlieb/Twitter-OAuth-iPhone and example of, I can just send the updates or send any direct messages, but I can't get any direct messages or Friend's IDs or any other things that can be found from the get methods.
How can I find any data that was parsed from the get methods? (Example: getPublicTimeline, getUpdate:(unsigned long)updateID, getDirectMessagesSinceID:, etc..)
Can anyone suggest how to solve this problem?
https://api.twitter.com/1/friends/ids.json?cursor=-1&screen_name=screennameofUser
yes.You have getFriends method.Also You have getFollowersIncludingCurrentStatus method.These methods will return to the following Callback,
- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier
{
//Here You can parse userInfo and get the list
}
Related
This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
how to get email of friends list using twitter api on iphone app.
Hi all, i am try to write app to get friends list of user on twitter, when user login twitter on my app.
I use twiiter api, but i can't do it.
Please help me with the problem. Thanks so much!
If your Twiiter Api has this MGTwitterEngine.h file.Look for getFollowersIncludingCurrentStatus method which give the list of your followers.
Use this Delegate Method from XAuthTwitterEngineDelegate
-(void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier
{
mFollowerArray = nil;
mFollowerArray = [userInfo retain];
}
Sounds like you need to be sending a GET statuses/friends request to the Twitter API.
For more information, you might want to read through that documentation I linked to, or re-ask your question here with more specific details about the problem you're having.
I want to publish something on a user's wall. The description should contain a reference to the user's name.
e.g.
"Max has just had scrambled eggs for breakfast."
Now I am able to post to a user's wall through
[facebook dialog:#"stream.publish"
andParams:params
andDelegate:self];
What I do not yet know how to do is include the (facebook)username in the description for the post.
Also, stream.publish is part of the Legacy REST API. What would the alternative look like in the Graph API? And can it be called exactly the same way?
So I seem to have figured out the first part, namely how to get information on the currently logged in user:
[facebook requestWithGraphPath:#"me" andDelegate:self];
But how do I know which request
- (void)request:(FBRequest *)request didLoad:(id)result
is currently processing? I don't see any unique properties in these requests coming from facebook. Right now my approach is to create custom objects that implement FBRequestDelegate and set them as delegates depending on which request I am making (well, actually many instances of one object with each one knowing which type of request it belongs to).
Anyone have a better solution to this?
I'm trying to get a Twitter iPhone app working using Matt Gemmell's MGTwitterEngine. I can post tweets OK, but I can't work out how to attach location data to those tweets... anyone have any idea?
I've never used MGTwitterEngine but from looking at the code, it should be as simple as calling sendUpdate:withLatitude:longitude:. What have you tried? What did and what did not work? Please be more specific.
There is no way to do post tweets with location information with MGTwitterEngine as of now. I am currently working on bringing the library up to date. You can check github.com/freeatnet/MGTwitterEngine/tree/v2-dev for updates. I'll be pushing a commit containing a method for geo-aware updates today.
UPD. See commit # http://github.com/freeatnet/MGTwitterEngine/commit/512be99cca9f5787192633455300dcd788c7830c for location-aware updates.
Method signatures:
(NSString *)sendUpdate:(NSString *)status;
(NSString *)sendUpdate:(NSString *)status fromLocationLat:(float)locLat locationLong:(float)locLong;
(NSString *)sendUpdate:(NSString *)status inReplyTo:(unsigned long long)updateID fromLocationLat:(float)locLat locationLong:(float)locLong;
I am using stream.publish to publish some info to a users wall. This all works fine.
I am not using FBStreamDialog because i do not want the user to be able to edit the message..... So i have set up my own UI.
It all works fine and the stream is published to the users wall, the only issue is that i do not understand the result obtained from the delegate method:
- (void)request:(FBRequest*)request didLoad:(id)result {
NSLog(#"result = %#", result);
}
I need to understand what the result is telling me so that i can handle any errors. Currently the following is being printed in the console but i do not know what this means:
result =
100000874992250_117813161591916
Any help or advice regarding this issue would be highly appreciated.
Thanks
Tom
Ok stupid question... i have found in the documentation that the response is:
"This call returns a post_id string
containing the ID of the stream item
upon success. If the call fails, it
returns an error code instead."
My question now is... how would i handle the response, so that i know there is not an error.
I cant check against all error codes because there are a lot of them!
Thanks
Tom
So, in my app, I am trying to use MGTwitterEngine to read from a certain user on Twitter, and then log the recent posts in an array. Is it possible to do this with this library? I am trying to do this without logging in. Any help would be appreciate, thank you!
It can be easily done with MGTwitterEngine. You do it this way:
MGTwitterEngine *twitterng = [[MGTwitterEngine alloc] initWithDelegate:self];
[twitterng getUserTimelineFor:#"userName" sinceID:0 startingAtPage:0 count:8];
and it will call delegate method
- (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier
Hope this helps.
You need to get the feed url that contains the rss feeds. You don't need to login for that. Use MGTwitterEngine to get the tweets and set them into array. Then you simply need to reload the tableview.
Hope this helps.
Thanks,
Madhup