forked from pnj/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fully implemented Saved Searches Methods, Block Methods
Separated Help methods Renamed some stuff in various places.
- Loading branch information
1 parent
475826b
commit dba1ff7
Showing
17 changed files
with
3,369 additions
and
185 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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 @@ | ||
// | ||
// ORSTwitterEngine+Block.h | ||
// Twitter Engine | ||
// | ||
// Created by Nicholas Toumpelis on 19/08/2009. | ||
// Copyright 2008-2009 Ocean Road Software, Nick Toumpelis. | ||
// | ||
// Version 0.7.1 | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
// IN THE SOFTWARE. | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "ORSTwitterEngine.h" | ||
|
||
@interface ORSTwitterEngine ( BlockMethods ) | ||
|
||
// Block methods | ||
- (BOOL) blockUser:(NSString *)userID; | ||
- (BOOL) unblockUser:(NSString *)userID; | ||
- (BOOL) blocksUserWithID:(NSString *)identifier; | ||
- (BOOL) blocksUserWithScreenName:(NSString *)screenName; | ||
- (NSArray *) blockedUsers; | ||
- (NSArray *) blockedIDs; | ||
|
||
@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,119 @@ | ||
// | ||
// ORSTwitterEngine+Block.h | ||
// Twitter Engine | ||
// | ||
// Created by Nicholas Toumpelis on 19/08/2009. | ||
// Copyright 2008-2009 Ocean Road Software, Nick Toumpelis. | ||
// | ||
// Version 0.7.1 | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
// IN THE SOFTWARE. | ||
|
||
#import "ORSTwitterEngine+Block.h" | ||
|
||
@implementation ORSTwitterEngine ( BlockMethods ) | ||
|
||
// Change these two. | ||
// blocks the user with the specified id | ||
- (BOOL) blockUser:(NSString *)userID { | ||
NSMutableString *path = [NSMutableString | ||
stringWithString:@"blocks/create/"]; | ||
[path appendString:userID]; | ||
[path appendString:@".xml"]; | ||
NSXMLNode *node = [self getNodeFromData:[self executeRequestOfType:@"POST" | ||
atPath:path | ||
synchronously:NO]]; | ||
if ([[node name] isEqualToString:@"user"]) { | ||
return YES; | ||
} else { | ||
return NO; | ||
} | ||
} | ||
|
||
// unblocks the user with the specified id | ||
- (BOOL) unblockUser:(NSString *)userID { | ||
NSMutableString *path = [NSMutableString | ||
stringWithString:@"blocks/destroy/"]; | ||
[path appendString:userID]; | ||
[path appendString:@".xml"]; | ||
NSXMLNode *node = [self getNodeFromData:[self executeRequestOfType:@"POST" | ||
atPath:path | ||
synchronously:NO]]; | ||
if ([[node name] isEqualToString:@"user"]) { | ||
return YES; | ||
} else { | ||
return NO; | ||
} | ||
} | ||
|
||
- (BOOL) blocksUserWithID:(NSString *)identifier { | ||
NSMutableString *path = [NSMutableString | ||
stringWithString:@"blocks/exists.xml?user_id="]; | ||
[path appendString:identifier]; | ||
NSXMLNode *node = [self getNodeFromData:[self executeRequestOfType:@"GET" | ||
atPath:path | ||
synchronously:synchronously]]; | ||
if ([[node name] isEqualToString:@"user"]) { | ||
return YES; | ||
} else { | ||
return NO; | ||
} | ||
} | ||
|
||
- (BOOL) blocksUserWithScreenName:(NSString *)screenName { | ||
NSMutableString *path = [NSMutableString | ||
stringWithString:@"blocks/exists.xml?screen_name="]; | ||
[path appendString:screenName]; | ||
NSXMLNode *node = [self getNodeFromData:[self executeRequestOfType:@"GET" | ||
atPath:path | ||
synchronously:synchronously]]; | ||
if ([[node name] isEqualToString:@"user"]) { | ||
return YES; | ||
} else { | ||
return NO; | ||
} | ||
} | ||
|
||
- (NSArray *) blockedUsers { | ||
NSString *path = @"blocks/blocking.xml"; | ||
NSData *data = [self executeRequestOfType:@"GET" | ||
atPath:path | ||
synchronously:synchronously]; | ||
NSXMLNode *node = [self getNodeFromData:data]; | ||
if ([[node name] isEqualToString:@"users"]) { | ||
return [self usersFromData:data]; | ||
} else { | ||
return NULL; | ||
} | ||
} | ||
|
||
- (NSArray *) blockedIDs { | ||
NSString *path = @"blocks/blocking/ids.xml"; | ||
NSData *data = [self executeRequestOfType:@"GET" | ||
atPath:path | ||
synchronously:synchronously]; | ||
NSXMLNode *node = [self getNodeFromData:data]; | ||
if ([[node name] isEqualToString:@"ids"]) { | ||
return [self IDsFromData:data]; | ||
} else { | ||
return NULL; | ||
} | ||
} | ||
|
||
@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
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
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,35 @@ | ||
// | ||
// ORSTwitterEngine+OAuth.h | ||
// Twitter Engine | ||
// | ||
// Created by Nicholas Toumpelis on 19/08/2009. | ||
// Copyright 2008-2009 Ocean Road Software, Nick Toumpelis. | ||
// | ||
// Version 0.7.1 | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
// IN THE SOFTWARE. | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "ORSTwitterEngine.h" | ||
|
||
@interface ORSTwitterEngine ( OAuthMethods ) | ||
|
||
// Placeholder for later | ||
|
||
@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,34 @@ | ||
// | ||
// ORSTwitterEngine+OAuth.h | ||
// Twitter Engine | ||
// | ||
// Created by Nicholas Toumpelis on 19/08/2009. | ||
// Copyright 2008-2009 Ocean Road Software, Nick Toumpelis. | ||
// | ||
// Version 0.7.1 | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to | ||
// deal in the Software without restriction, including without limitation the | ||
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
// sell copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
// IN THE SOFTWARE. | ||
|
||
#import "ORSTwitterEngine+OAuth.h" | ||
|
||
@implementation ORSTwitterEngine ( OAuthMethods ) | ||
|
||
// Placeholder for later | ||
|
||
@end |
Oops, something went wrong.