Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 10 additions & 26 deletions MGTwitterEngine.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@

#import "MGTwitterEngine.h"
#import "MGTwitterHTTPURLConnection.h"
#import "OAuthConsumer.h"
#import "OAMutableURLRequest.h"

#import "NSData+Base64.h"

#ifndef USE_LIBXML
// if you wish to use LibXML, add USE_LIBXML=1 to "Precompiler Macros" in Project Info for all targets
# define USE_LIBXML 0
#endif

#if YAJL_AVAILABLE
#define API_FORMAT @"json"

Expand All @@ -30,25 +25,12 @@

#import "MGTwitterTouchJSONParser.h"
#else
#define API_FORMAT @"xml"

#if USE_LIBXML
#import "MGTwitterStatusesLibXMLParser.h"
#import "MGTwitterMessagesLibXMLParser.h"
#import "MGTwitterUsersLibXMLParser.h"
#import "MGTwitterMiscLibXMLParser.h"
#import "MGTwitterSocialGraphLibXMLParser.h"
#else
#import "MGTwitterStatusesParser.h"
#import "MGTwitterUsersParser.h"
#import "MGTwitterMessagesParser.h"
#import "MGTwitterMiscParser.h"
#import "MGTwitterSocialGraphParser.h"
#import "MGTwitterUserListsParser.h"
#endif

#error "Need to define either YAJL_AVAILABLE or TOUCHJSON_AVAILABLE in MGTwitterEngineGlobalHeader.h!"

#endif

#define TWITTER_DOMAIN @"api.twitter.com/1"
#define TWITTER_DOMAIN @"api.twitter.com/1.1"

#if YAJL_AVAILABLE || TOUCHJSON_AVAILABLE
#define TWITTER_SEARCH_DOMAIN @"search.twitter.com"
Expand Down Expand Up @@ -415,7 +397,7 @@ - (NSString *)_encodeString:(NSString *)string
NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,
(CFStringRef)string,
NULL,
(CFStringRef)@";/?:@&=$+{}<>,",
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8);
return [result autorelease];
}
Expand Down Expand Up @@ -653,7 +635,7 @@ - (NSMutableURLRequest *)_baseRequestWithMethod:(NSString *)method
[self _encodeString:_username], [self _encodeString:_password],
domain, fullPath];
#endif

NSURL *finalURL = [NSURL URLWithString:urlString];
if (!finalURL) {
return nil;
Expand Down Expand Up @@ -888,7 +870,7 @@ - (void)parsingSucceededForRequest:(NSString *)identifier
withParsedObjects:(NSArray *)parsedObjects
{
// Forward appropriate message to _delegate, depending on responseType.
NSLog(@"here at parsingSucceededForRequest");
//NSLog(@"here at parsingSucceededForRequest");
switch (responseType) {
case MGTwitterStatuses:
case MGTwitterStatus:
Expand Down Expand Up @@ -1270,6 +1252,8 @@ - (NSString *)sendUpdate:(NSString *)status inReplyTo:(MGTwitterEngineID)updateI

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
[params setObject:trimmedText forKey:@"status"];
//$$fb added this per Twitter documentation
[params setObject:@"true" forKey:@"include_entities"];
if (updateID > 0) {
[params setObject:[NSString stringWithFormat:@"%llu", updateID] forKey:@"in_reply_to_status_id"];
}
Expand Down
50 changes: 0 additions & 50 deletions MGTwitterLibXMLParser.h

This file was deleted.

Loading