Skip to content

Instantly share code, notes, and snippets.

@gonzalezreal
Created October 24, 2012 07:29
Show Gist options
  • Select an option

  • Save gonzalezreal/3944553 to your computer and use it in GitHub Desktop.

Select an option

Save gonzalezreal/3944553 to your computer and use it in GitHub Desktop.
- (SLRequest *)requestForOldTweets
{
TGRTweet *firstTweet = [TGRTweet firstTweetInManagedObjectContext:self.managedObjectContext];
if (!firstTweet) {
NSLog(@"requestForOldTweets shouldn't be called when the cache is empty");
return nil;
}
NSNumber *maxIdentifier = [NSNumber numberWithLongLong:[firstTweet.identifier longLongValue] - 1];
NSDictionary *parameters = @{
@"include_rts" : @"true",
@"max_id" : [maxIdentifier stringValue]
};
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeTwitter
requestMethod:SLRequestMethodGET
URL:[NSURL URLWithString:kHomeTimelineURL]
parameters:parameters];
request.account = self.account;
return request;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment