Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 38e9db8
Showing
22 changed files
with
1,948 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
|
||
project.xcworkspace | ||
xcuserdata |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// TRRequestMethod.h | ||
// Twitbit | ||
// | ||
// Created by John Debay on 7/18/11. | ||
// Copyright 2011 High Order Bit. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
typedef enum { | ||
TKRequestMethodGET, | ||
TKRequestMethodPOST, | ||
TKRequestMethodDELETE | ||
} TKRequestMethod; | ||
|
||
|
||
@interface NSString (TRRequestMethodHelpers) | ||
|
||
+ (id)stringForRequestMethod:(TKRequestMethod)requestMethod; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// TRRequestMethod.m | ||
// Twitbit | ||
// | ||
// Created by John Debay on 7/18/11. | ||
// Copyright 2011 High Order Bit. All rights reserved. | ||
// | ||
|
||
#import "TKRequestMethod.h" | ||
|
||
@implementation NSString (TKRequestMethodHelpers) | ||
|
||
+ (id)stringForRequestMethod:(TKRequestMethod)requestMethod | ||
{ | ||
NSString *s = nil; | ||
|
||
switch (requestMethod) { | ||
case TKRequestMethodGET: | ||
s = @"GET"; | ||
break; | ||
case TKRequestMethodPOST: | ||
s = @"POST"; | ||
break; | ||
case TKRequestMethodDELETE: | ||
s = @"DELETE"; | ||
break; | ||
} | ||
|
||
return s; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// TwitterOAuthService.h | ||
// Twitbit | ||
// | ||
// Created by John Debay on 7/16/11. | ||
// Copyright 2011 High Order Bit. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
typedef void(^TKTokenCompletion)(NSString *urlQueryString, NSError *error); | ||
typedef void(^TKCredentialsCompletion)(NSDictionary *creds, NSError *error); | ||
|
||
@interface TKTwitterOAuthAuthenticator : NSObject | ||
|
||
@property (nonatomic, copy, readonly) NSString *consumerKey; | ||
@property (nonatomic, copy, readonly) NSString *consumerSecret; | ||
|
||
#pragma mark - Initialization | ||
|
||
- (id)initWithConsumerKey:(NSString *)key consumerSecret:(NSString *)secret; | ||
|
||
#pragma mark - Fetching the token | ||
|
||
- (void)fetchTwitterTokenWithCallbackURL:(NSURL *)callbackURL | ||
completion:(TKTokenCompletion)completion; | ||
|
||
#pragma mark - Authorizing the token | ||
|
||
- (void)authenticateTwitterToken:(NSString *)token | ||
withVerifier:(NSString *)verifier | ||
completion:(TKCredentialsCompletion)completion; | ||
|
||
#pragma mark - URLs | ||
|
||
+ (NSURL *)twitterTokenURL; | ||
+ (NSURL *)authenticationURLForOAuthToken:(NSString *)token; | ||
|
||
+ (NSURL *)twitterAuthorizationURL; | ||
|
||
@end |
Oops, something went wrong.