signatureProvider:nil] autorelease];
if (method) {
[theRequest setHTTPMethod:method];
}
[theRequest setHTTPShouldHandleCookies:NO];
// Set headers for client information, for tracking purposes at
Twitter.
[theRequest setValue:_clientNameforHTTPHeaderField:@"X-Twitter-
Client"];
[theRequest setValue:_clientVersion forHTTPHeaderField:@"X-Twitter-
Client-Version"];
[theRequest setValue:_clientURL forHTTPHeaderField:@"X-Twitter-
Client-URL"];
// Set the request body if this is a POST request.
BOOL isPOST = (method && [method isEqualToString:@"POST"]);
if (isPOST) {
// Set request body, if specified (hopefully so), with
'source' parameter if appropriate.
NSString *finalBody = @"";
if (body) {
finalBody = [finalBody stringByAppendingString:body];
}
if (_clientSourceToken) {
finalBody = [finalBody stringByAppendingString:[NSString
stringWithFormat:@"%...@source=%@",
(body) ?
@"&" : @"?" ,
_clientSourceToken]];
}
if (finalBody) {
[theRequest setHTTPBody:[finalBody
dataUsingEncoding:NSUTF8StringEncoding]];
}
}
//
// modificaiton from the base clase
// our version "prepares" the oauth url request
//
[theRequest prepare];
// Create a connection using this request, with the default
timeout and caching policy,
// and appropriate Twitter request and response types for parsing
and error reporting.
MGTwitterHTTPURLConnection *connection;
connection = [[MGTwitterHTTPURLConnection alloc]
initWithRequest:theRequest
delegate:self
requestType:requestType
responseType:responseType];
if (!connection) {
return nil;
} else {
[_connections setObject:connection forKey:[connection
identifier]];
[connection release];
}
return [connection identifier];
}
Thanks,
Carlos
On Oct 16, 1:53 pm, Matt Harris wrote:
> In addition make sure you add the parameter include_rts=1 to the request.
>
> The include_rts flag instructs the API to include retweets in the response.
> Looking at the timeline you requested it looks as if the last 20 Tweets by
> that user are retweets - which, by default, are not included in the timeline
> but are included in the count.
>
> Best,
> Matt
>
> On Oct 16, 2010, at 12:24, Taylor Singletary
> wrote:
>
>
>
> > It should be pointed out that those aren't valid API URLs..
>
> > You want to execute these requests against API.twitter.com/1/resource...
>
> > The best way to construct your URL would be like this: (it reduces
> > ambiguity)
>
> >https://api.twitter.com/1/statuses/user_timeline.json?screen_name=jus...
>
> > Finally, we are having some strange issues with certain timelines. If
> > you're running into this, it means the timeline is being a bit erratic. Try
> > requesting a higher count, like 100. We are looking into this behavior and
> > hope to fix it soon.
>
> > Taylor
>
> > On Sat, Oct 16, 2010 at 2:35 AM, CarlosChacon
> > wrote:
> > I'm trying to access justinbieber timeline but its returning "[]"...
> > I'm using this URL:
> >https://twitter.com/statuses/user_timeline/justinbieber.json?count=20
>
> > If I try the timeline for other users it works fine. for example:
> >https://twitter.com/statuses/user_timeline/cnn.json?count=20
>
> > Any idea why this is happening?
>
> > If I go tohttp://twitter.com/justinbieberit seems to be okay, but
> > when
> > usinghttps://twitter.com/statuses/user_timeline/justinbieber.json?count=20
> > it keeps returning an empty array...
>
> > --
> > Twitter developer documentation and resources:http://dev.twitter.com/doc
> > API updates via Twitter:http://twitter.com/twitterapi
> > Issues/Enhancements Tracker:http://code.google.com/p/twitter-api/issues/list
> > Change your membership to this
> > group:http://groups.google.com/group/twitter-development-talk
>
> > --
> > Twitter developer documentation and resources:http://dev.twitter.com/doc
> > API updates via Twitter:http://twitter.com/twitterapi
> > Issues/Enhancements Tracker:http://code.google.com/p/twitter-api/issues/list
> > Change your membership to this
> > group:http://groups.google.com/group/twitter-development-talk
--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
http://groups.google.com/group/twitter-development-talk