forked from mattgemmell/MGTwitterEngine
-
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.
Added UserList Request and Response type
- Loading branch information
Showing
3 changed files
with
66 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
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,17 @@ | ||
// | ||
// MGTwitterUserListsParser.h | ||
// MGTwitterEngine | ||
// | ||
// Created by Clinton Shryock on 6/10/10. | ||
// Copyright 2010 scary-robot. All rights reserved. | ||
// | ||
|
||
#import "MGTwitterEngineGlobalHeader.h" | ||
|
||
#import "MGTwitterStatusesParser.h" | ||
|
||
@interface MGTwitterUserListsParser : MGTwitterStatusesParser { | ||
|
||
} | ||
|
||
@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,47 @@ | ||
// | ||
// MGTwitterUserListsParser.m | ||
// MGTwitterEngine | ||
// | ||
// Created by Clinton Shryock on 6/10/10. | ||
// Copyright 2010 scary-robot. All rights reserved. | ||
// | ||
|
||
#import "MGTwitterUserListsParser.h" | ||
|
||
|
||
@implementation MGTwitterUserListsParser | ||
|
||
#pragma mark NSXMLParser delegate methods | ||
|
||
|
||
- (void)parser:(NSXMLParser *)theParser didStartElement:(NSString *)elementName | ||
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName | ||
attributes:(NSDictionary *)attributeDict | ||
{ | ||
//NSLog(@"Started element: %@ (%@)", elementName, attributeDict); | ||
[self setLastOpenedElement:elementName]; | ||
|
||
if ([elementName isEqualToString:@"list"]) { | ||
// Make new entry in parsedObjects. | ||
NSMutableDictionary *newNode = [NSMutableDictionary dictionaryWithCapacity:0]; | ||
[parsedObjects addObject:newNode]; | ||
currentNode = newNode; | ||
} else if (currentNode) { | ||
// Create relevant name-value pair. | ||
[currentNode setObject:[NSMutableString string] forKey:elementName]; | ||
} | ||
} | ||
|
||
- (void)parser:(NSXMLParser *)theParser didEndElement:(NSString *)elementName | ||
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName | ||
{ | ||
[super parser:theParser didEndElement:elementName namespaceURI:namespaceURI qualifiedName:qName]; | ||
|
||
if ([elementName isEqualToString:@"user"]) { | ||
[self addSource]; | ||
currentNode = nil; | ||
} | ||
} | ||
|
||
|
||
@end |