aral / xauthtwitterengine Goto Github PK
View Code? Open in Web Editor NEWA collection of libraries in Objective-C for working with Twitter's xAuth implementation.
A collection of libraries in Objective-C for working with Twitter's xAuth implementation.
XAuthTwitterEngine library and demo for iPhone. by Aral Balkan (@aral, http://aralbalkan.com) Copyright 2010 Aral Balkan. All Rights Reserved. License: MIT Removes a lot of the unnecessary oAuth browser-based authentication bloat from the Twitter+oAuth Source and provides a very simple example to demonstrate how to use Twitter's new xAuth authentication system. The easiest way to use the library in your own projects is to drag the Twitter+oAuth folder from the Libraries folder in the demo application to your own project. Also, don't forget to add libxml2.dylib to your new project. If you find this helpful, I would really appreciate it if you could tweet or blog about @feathers_app my Twitter app for iPhone: Feathers: decorate your tweets. http://feathersapp.com * * * Special thanks to: Norio Nomura for sharing his xAuth implementation: http://github.com/norio-nomura/ntlniph/commit/5ce25d68916cd45254c7ff2ba9b91de4f324899a Steve Reynolds for alerting me to Norio Nomura's xAuth code, with which I updated Ben's oAuth Twitter engine for xAuth. Ben's original notes for Twitter+OAuth follow: Twitter+OAuth Source and Example for iPhone Glommed together by Ben Gottlieb copyright 2009 Stand Alone, Inc - all rights reserved. License: BSD, If you use it, please include the following text somewhere in your application's user-facing text: "Includes Twitter+OAuth code by Ben Gottlieb" The goal of this was to create a drop-in code package for iPhone apps that want to access Twitter via OAuth. The main benefit here is that the source line on the Twitter page will say your app name, rather than "from web". This includes source taken from several other open frameworks, listed below. Most of the heavy lifting was all done by them, I just synthesized it into a (hopefully) easily digestible chunk. I decided not to do the whole thing as a static library since most developers are already using Matt Gemmell's MGTwitterEngine, and there was no reason to duplicate code. It adds about 200k to the final size of your project, mainly due to the OAuth library. Enjoy, and please let me know if you have any feedback! Ben Gottlieb [email protected] == Major Changes Log == 2/24/10 - added additional PIN checks in case Twitter changes the way they pass the PIN back - if all else fails, prompt the user to copy their PIN. The app will grab this and use it - this last part only works on OS 3.x and later, Everything else should work fine on 2.x. - integrated the latest build of MGTwitterEngine Example: Use the project in the Demo folder. You'll need to replace the strings in Demo/Src/OAuthTwitterDemoViewController.m with your own consumer key and consumer secret (visit http://twitter.com/oauth_clients/new to obtain these). Built using: MGTwitterEngine by Matt Gemmell http://mattgemmell.com License: http://mattgemmell.com/license I have included 1.0.8 release of the MGTwitterEngine unchanged in this project. The goal is to create an easily buildable project that has no dependancies. OAuthConsumer Framework Jon Crosby http://code.google.com/p/oauth/ License: http://www.apache.org/licenses/LICENSE-2.0 I have included a pre-built binary of the OAuthConsumer Framework unchanged in this project. The goal is to create an easily buildable project that has no dependancies. OAuth-MyTwitter Chris Kimpton http://github.com/kimptoc/MGTwitterEngine-1.0.8-OAuth-MyTwitter/tree/master License: Couldn't find one. Will amend this if I do. Some code from this project was used to create the YHOATwitterEngine subclass of MGTwitterEngine. Thanks Chris, you made this project a simple! OAuth Test Application Isaiah Carew http://github.com/yourhead/OAuth_ObjC_Test_App/tree/master License: None found. Isaiah's test app worked great on the Mac, but didn't make use of the PIN number passed back by Twitter, and also needed to be re-worked to work on the phone.
hi,
i got a bellow error if know how it solve so pls. give the solution of this problem.
Request C836716C-8A3E-46FC-8289-6D08C99EF2BB failed with error: Error Domain=HTTP Code=401 "The operation couldn’t be completed. (HTTP error 401.)"
Terminating in response to SpringBoard's termination.
Hi,
How can I use this so the user just enters their username, password and then it post a tweet? I have had this done using basic auth. and need to switch. Thank you!
There are some issues building this under the iPhone SDK 4.0b3
I'm using a valid key and secret, and the app successfully gets an xauth token. When I try to send a test tweet, I see the following in the console:
2010-08-20 09:00:33.769 XAuthTwitterEngineDemo[7934:207] Twitter request failed: 1AC8A041-B09F-4F79-8ACA-1AB8A7F82FB8 with error:Error Domain=HTTP Code=401 "The operation couldn’t be completed. (HTTP error 401.)"
I change the libauth.a to build on xcode 3.2.3 on Ipad. And nothing the app can get token all object return out of scope.
Any Idea?
Thanks!!!!
Not really an issue, but how would you allow a user to log out of twitter to allow another user account to be used.
Thanks for your work BTW... I'm still waiting on twitter confirming my apps xAuth access.
Every time I retrieve a tweet the message id is 2147483647.
something wrong with XML parsing?
I know this code is really old, but some people are still using it.
(void) accessTokenTicket:(OAServiceTicket )ticket didFailWithError:(NSError *) error {
NSLog(@"access token did fail **************");
[self performSelectorOnMainThread:@selector(callDelegateOnMainThreadWithAccessTokenTicket:didFailWithError:) withObject:error waitUntilDone:[NSThread isMainThread]];
}
(void) callDelegateOnMainThreadWithAccessTokenTicket:(OAServiceTicket *)ticket didFailWithError:(NSError *) error {
[self.delegate accessTokenTicket:ticket didFailWithError:error];
}
Notice that the call to performSelectorOnMainThread passes error in the withObject parameter. Notice that callDelegateOnMainThreadWithAccessTokenTicket expects error as the SECOND parameter.
The only reason this ever worked is because in
takes 'error' as the second parameter, so it's already in the correct register (on ARM). The regs get saved to the stack, then they get pulled out later on, and miraculously, and thankfully, the error arg is in the right place. It crashes the simulator reliably, because the x86 calling standard generally passes parameters on the stack rather than in regs so you need to be a lot luckier to get things in the right place.
,
thanks for the code.
In my applicatoin for twitter I have this problem when I try to request Token for Twitter :
'Error Domain=NSURLErrorDomain Code=-1012 UserInfo?=0x10a9b20 "Operation could not be completed. (NSURLErrorDomain error -1012.)"'
For resolve this problem I changed :
NSURL *url = [NSURL URLWithString:@"https://api.twitter.com/oauth/access_token"];
for
NSURL *url = [NSURL URLWithString:@"http://twitter.com/oauth/request_token"];
in class ExchangeCredentialsOperation, because this method need the request_token.
I hope help.
In XAuthTwitterEngine.m _sendRequestWithMethod comments out the appending of parameters to the query string. This causes all special parameters passed to be ignored such as in getFollowedTimelineSinceID:startingAtPage:count: so that pages and counts cannot be specified. uncommenting lines 266 - 268 fixes the issue.
My biggest question is why were those lines commented out? The inline comment only states that it is a modification of the base class but doesn't give an explanation as to why.
So was able to build and run with 3.2, but now trying to update for 4.0 and I keep getting the following when I build with the new 4.0 GM release:
Undefined symbols:
"OBJC_CLASS$_OAConsumer", referenced from:
objc-class-ref-to-OAConsumer in XAuthTwitterEngine.o
"OBJC_CLASS$_OAToken", referenced from:
objc-class-ref-to-OAToken in XAuthTwitterEngine.o
"OBJC_CLASS$_OAMutableURLRequest", referenced from:
objc-class-ref-to-OAMutableURLRequest in XAuthTwitterEngine.o
objc-class-ref-to-OAMutableURLRequest in ExchangeCredentialsOperation.o
"OBJC_CLASS$_OADataFetcher", referenced from:
objc-class-ref-to-OADataFetcher in ExchangeCredentialsOperation.o
"OBJC_CLASS$_OARequestParameter", referenced from:
objc-class-ref-to-OARequestParameter in ExchangeCredentialsOperation.o
My Tweet Ids are beyound unsigned long, I noticed on the original MGTwitterEngine it changed from unsigned long to MGTwitterEngineID.
Why MGTwitterEngine was changed in
Shouldn't there be a dealloc method?
Hi,
Great Code.
When a password has a special character such as +, this causes the xAuth process to fail. I am aware that I need to url-encode it before (or maybe not?), anyways I tried both cases, but no luck. I know it is from the + sign, but still cant get it to work. Note: the password works fine when using regular Basic authentication
Any comments? or help would be great.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.