[twitter-dev] Re: Cannot update status with Twitter PHP Library

2010-06-25 Thread Straube
I think I'm doing some confusion with the libraries. I'm using
EpiTwitter. :S

But even though I use the method post_statusesUpdate(), the server
response is the same: "bad request".

I've commented the line 148, in EpiOAuth.php, 'cause I was getting a
PHP warning:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

This may be causing the request error?

I'd better use the Abraham's library?

Thanks,

Straube


On 25 jun, 17:00, Sam Wierema  wrote:
> If you're using Abraham's library you should drop the .json and the
> first slash in the call:
> $return = $twitter->post( 'statuses/update', array( 'status' =>
> 'TEST' ) );
>
> If you're using EpiTwitter (not Abraham's library) you should probably
> use something like this (according to 
> this:http://wiki.github.com/jmathai/twitter-async/#methodnames):
> $return = $twitter->post_statusesUpdate( array( 'status' =>
> 'TEST' ) );
>
> On Jun 25, 8:14 pm, Straube  wrote:
>
>
>
> > Hi,
>
> > I'm trying to update an account status with the Abraham's PHP Library,
> > but I'm getting the following exception message:
>
> > Bad request / Your browser sent a request that this server could not
> > understand.
>
> > I've already authorized my application to connect with my test account
> > and I saved the authentication data in constants. I'm using the code
> > bellow to do the update:
>
> > try {
> >   $twitter = new EpiTwitter(Config::TWITTER_APP_TOKEN,
> > Config::TWITTER_APP_SECRET, Config::TWITTER_OAUTH_TOKEN,
> > Config::TWITTER_OAUTH_SECRET);
> >   $return = $twitter->post('/statuses/update.json', array ( 'status'
> > => 'TEST' ));
> >   echo $return->response;} catch (Exception $e) {
>
> >   echo $e->getMessage();
>
> > }
>
> > API methods that uses 'get' instead of 'post' (e.g. account/
> > verify_credentials) works without problem.
>
> > Thanks in advance.
>
> > Straube


Re: [twitter-dev] Transitioning from Basic Auth to OAuth Guide (need your help!)

2010-06-25 Thread Andrew W. Donoho

On Jun 25, 2010, at 15:42 , Taylor Singletary wrote:

> However, we'd love to collect together specific implementation stories of 
> developers who've successfully made the transition and highlight them here.




Taylor et. al.,

As someone with his own custom iPhone REST stack, I scaled the 
OAuth/xAuth wall. In my view, everyone made this transition seem much tougher 
than it really is. Here's my advice:

0) If you don't have a REST stack, git one! There are many out there. I started 
with one. (Very little of it remains in my apps but that is another matter. It 
got me started.)

1) Your http request tends to change in exactly one place -- setting your 
authorization header. Don't freak out about changing your code base. I added 3 
methods to my stack: create a signature string, sign the signature string and 
create the OAuth header. I changed one method to sort and URL encode my 
parameters. In all, this is a pretty minimal change. I cribbed much of this 
from other open source implementations.

1a) Calculating a signature string is not as daunting as it looks. Some pseudo 
code would have helped. Twitter's recent documentation helped.
1b) Calculating HMAC-SHA1 signature is simple too. If you use the common crypto 
library (CDSA derived), it takes 6 lines.
1c) What wasn't too clear was how the xAuth process interacted with your 
tokens. (Yes, I knew they were missing. What wasn't apparent was that I had to 
leave the conjoining '&' in the signature secret.)

2) The WWDC slides sum up most of the issues but leave out the supporting nitty 
gritty code.

Finally, we all know that xAuth has a huge security hole -- the 
embedded consumer secret in the client app. I have a feature request into Apple 
to allow the passing of encrypted secrets to native applications through App 
Store binary code. I have also posted it to OpenRadar at this link: 
. If members of this community agree that 
we need a solution to this problem, then please consider filing enhancement 
requests with Apple via bugreporter and reference my request. (If someone else 
has a similar request, I'll be happy to reference their request in my 
communications with Apple.)

Anon,
Andrew

Andrew W. Donoho
Donoho Design Group, L.L.C.
a...@ddg.com, +1 (512) 750-7596

"We did not come to fear the future. 
We came here to shape it."

-- President Barack Obama, Sept. 2009







Re: [twitter-dev] Re: Streaming API OAuth explanation?

2010-06-25 Thread Taylor Singletary
Wil,

Does your OAuth code work against other aspects of the Twitter API? Can you
verify if your system's clock is within 5 minutes or so of the times
returned by our system? (You can see the current server time in an HTTP
header of any of our responses).

Are you sure that your code is actually POSTing the POST body along with the
request?

Seems like you are really close.

On Fri, Jun 25, 2010 at 10:10 AM, Wil  wrote:

> Hi John,
>
> Uhh, care to elaborate? I don't quite get what you meant...
>
> Thanks,
> Wil
>
> On Jun 24, 11:17 pm, John Kalucki  wrote:
> > Aside from the oAuth issue, which others can address, the only valid
> > delimited value is length.
> >
> > -John
> >
> >
> >
> > On Thu, Jun 24, 2010 at 7:58 AM, Wil  wrote:
> > > I'm getting this response:
> >
> > > HTTP/1.1 401 Unauthorized
> > > Content-Length: 1296
> > > Cache-Control: must-revalidate,no-cache,no-store
> > > Content-Type: text/html; charset=iso-8859-1
> > > Server: Jetty(6.1.17)
> > > WWW-Authenticate: Basic realm="Firehose"
> >
> > >  
> > > 
> > > 
> > > Error 401 UNAUTHORIZED
> > > 
> > > 
> > > HTTP ERROR: 401
> > > Problem accessing /1/statuses/filter.json. Reason:
> > > UNAUTHORIZED
> > > Powered by Jetty://
> >
> > > Here's what I POSTed(oauth tokens are filtered out):
> >
> > > REQUEST: POSThttp://stream.twitter.com/1/statuses/filter.json
> > > Authorization: OAuth
> >
> > >
> oauth_consumer_key="#",oauth_token="",oauth_nonce="#",oauth
> _timestamp="#",oauth_signature_method="HMAC-
> > > SHA1",oauth_signature="",oauth_version="1.0",
> > > Content-Type: application/x-www-form-urlencoded
> > > Vary: Accept-Encoding
> > > Connection: close
> >
> > > source=softwarename&delimited=1&follow=156934710
> >
> > > On Jun 23, 1:33 am, John Kalucki  wrote:
> > > > OAuthshould work fine onstream.twitter.com
> >
> > > > -John Kaluckihttp://twitter.com/jkalucki
> > > > Infrastructure, Twitter Inc.
> >
> > > > On Tue, Jun 22, 2010 at 10:00 AM, Wil  wrote:
> > > > > I'm a bit dumbfounded here...
> >
> > > > > I've been trying to login tostream.twitter.com usingOAuth
> > > > > (particularly, I've been trying to access
> > > > >http://stream.twitter.com/1/statuses/filter.json?follow=). I
> used
> > > > > the access keys obtained fromhttps://
> > > api.twitter.com/oauth/access_token
> > > > > however, I've been getting 401 errors. I've tried basic
> authentication
> > > > > and it works fine.
> >
> > > > > Does that mean thatstream:statuses/filter is still can only accept
> > > > > basic authentication?
> >
> > > > > Regards,
> > > > > Wil
> >
> > > > > On May 25, 5:51 am, John Kalucki  wrote:
> > > > >> We haven't announced our plans for streaming andoAuth, beyond
> stating
> > > that
> > > > >> User Streams will only be onoAuth.
> >
> > > > >> On Mon, May 24, 2010 at 1:57 PM, 140dev <140...@gmail.com> wrote:
> > > > >> > Does this mean that the streaming API will also make the switch
> from
> > > > >> > basic authentication toOAuthat the end of June?
> >
> > > > >> > On Mon, May 24, 2010 at 4:50 PM, Mark McBride <
> mmcbr...@twitter.com
> >
> > > > >> > wrote:
> > > > >> > >OAuthis now enabled onstream.twitter.com.  I'll also send a
> note
> > > out
> > > > >> > > to the announce list
> >
> > > > >> > >   ---Mark
> >
> > > > >> > >http://twitter.com/mccv
> >
> > > > >> > > On Mon, May 24, 2010 at 12:30 PM, Aaron Rankin <
> aran...@gmail.com
> >
> > > > >> > wrote:
> > > > >> > >> Hi,
> >
> > > > >> > >> Is there an ETA for enablingoauthonstream.twitter.com?
> >
> > > > >> > >> Thanks,
> > > > >> > >> Aaron
> >
> > > > >> > >> On May 13, 1:11 pm, John Kalucki  wrote:
> > > > >> > >>> OAuthis not enabled onstream.twitter.com. You can try on
> > > > >> > >>> chirpstream.twitter.com.
> >
> > > > >> > >>> On Thu, May 13, 2010 at 10:53 AM, Lucas Vickers <
> > > > >> > lucasvick...@gmail.com> wrote:
> > > > >> > >>> > I am writing my own c++ basedOAuthlibrary.  I know there
> is
> > > liboauth
> > > > >> > >>> > but I like to do things myself to learn.
> >
> > > > >> > >>> > Anyhow I am trying to accesshttp://
> > > > >> >stream.twitter.com/1/statuses/sample.xml
> > > > >> > >>> > and I keep getting 401.
> >
> > > > >> > >>> > I have verified pretty much every parameter, and used the
> tool
> > > on
> >
> > >http://hueniverse.com/2008/10/beginners-guide-to-oauth-part-iv-signin.
> ..
> > > > >> > >>> > to verify my signature is correct. I used twurl to obtain
> the
> > > user
> > > > >> > >>> > access tokens to my account.
> >
> > > > >> > >>> > After doing some reading I'm no longer convinced that
> > > thestreaming
> > > > >> > >>> > server even supportsoauth.
> >
> > > > >> > >>> > can you fill me in on the current status
> ofstream.twitter.comand
> > > > >> > >>> >oauth?
> >
> > > > >> > >>> > thanks!
> > > > >> > >>> > Lucas
> >
> > > > >> > >>> > On Apr 20, 11:02 pm, Jonathon Hill 
> > > wrote:
> > > > >> > >>> >> Thanks Taylor for the very detailed and helpful response!
> >
> > > > >> > >>> >> Jonathon

Re: [twitter-dev] Re: Streaming API OAuth explanation?

2010-06-25 Thread John Kalucki
You have delimited=1, not delimited=length.

-John


On Fri, Jun 25, 2010 at 10:10 AM, Wil  wrote:

> Hi John,
>
> Uhh, care to elaborate? I don't quite get what you meant...
>
> Thanks,
> Wil
>
> On Jun 24, 11:17 pm, John Kalucki  wrote:
> > Aside from the oAuth issue, which others can address, the only valid
> > delimited value is length.
> >
> > -John
> >
> >
> >
> > On Thu, Jun 24, 2010 at 7:58 AM, Wil  wrote:
> > > I'm getting this response:
> >
> > > HTTP/1.1 401 Unauthorized
> > > Content-Length: 1296
> > > Cache-Control: must-revalidate,no-cache,no-store
> > > Content-Type: text/html; charset=iso-8859-1
> > > Server: Jetty(6.1.17)
> > > WWW-Authenticate: Basic realm="Firehose"
> >
> > >  
> > > 
> > > 
> > > Error 401 UNAUTHORIZED
> > > 
> > > 
> > > HTTP ERROR: 401
> > > Problem accessing /1/statuses/filter.json. Reason:
> > > UNAUTHORIZED
> > > Powered by Jetty://
> >
> > > Here's what I POSTed(oauth tokens are filtered out):
> >
> > > REQUEST: POSThttp://stream.twitter.com/1/statuses/filter.json
> > > Authorization: OAuth
> >
> > >
> oauth_consumer_key="#",oauth_token="",oauth_nonce="#",oauth
> _timestamp="#",oauth_signature_method="HMAC-
> > > SHA1",oauth_signature="",oauth_version="1.0",
> > > Content-Type: application/x-www-form-urlencoded
> > > Vary: Accept-Encoding
> > > Connection: close
> >
> > > source=softwarename&delimited=1&follow=156934710
> >
> > > On Jun 23, 1:33 am, John Kalucki  wrote:
> > > > OAuthshould work fine onstream.twitter.com
> >
> > > > -John Kaluckihttp://twitter.com/jkalucki
> > > > Infrastructure, Twitter Inc.
> >
> > > > On Tue, Jun 22, 2010 at 10:00 AM, Wil  wrote:
> > > > > I'm a bit dumbfounded here...
> >
> > > > > I've been trying to login tostream.twitter.com usingOAuth
> > > > > (particularly, I've been trying to access
> > > > >http://stream.twitter.com/1/statuses/filter.json?follow=). I
> used
> > > > > the access keys obtained fromhttps://
> > > api.twitter.com/oauth/access_token
> > > > > however, I've been getting 401 errors. I've tried basic
> authentication
> > > > > and it works fine.
> >
> > > > > Does that mean thatstream:statuses/filter is still can only accept
> > > > > basic authentication?
> >
> > > > > Regards,
> > > > > Wil
> >
> > > > > On May 25, 5:51 am, John Kalucki  wrote:
> > > > >> We haven't announced our plans for streaming andoAuth, beyond
> stating
> > > that
> > > > >> User Streams will only be onoAuth.
> >
> > > > >> On Mon, May 24, 2010 at 1:57 PM, 140dev <140...@gmail.com> wrote:
> > > > >> > Does this mean that the streaming API will also make the switch
> from
> > > > >> > basic authentication toOAuthat the end of June?
> >
> > > > >> > On Mon, May 24, 2010 at 4:50 PM, Mark McBride <
> mmcbr...@twitter.com
> >
> > > > >> > wrote:
> > > > >> > >OAuthis now enabled onstream.twitter.com.  I'll also send a
> note
> > > out
> > > > >> > > to the announce list
> >
> > > > >> > >   ---Mark
> >
> > > > >> > >http://twitter.com/mccv
> >
> > > > >> > > On Mon, May 24, 2010 at 12:30 PM, Aaron Rankin <
> aran...@gmail.com
> >
> > > > >> > wrote:
> > > > >> > >> Hi,
> >
> > > > >> > >> Is there an ETA for enablingoauthonstream.twitter.com?
> >
> > > > >> > >> Thanks,
> > > > >> > >> Aaron
> >
> > > > >> > >> On May 13, 1:11 pm, John Kalucki  wrote:
> > > > >> > >>> OAuthis not enabled onstream.twitter.com. You can try on
> > > > >> > >>> chirpstream.twitter.com.
> >
> > > > >> > >>> On Thu, May 13, 2010 at 10:53 AM, Lucas Vickers <
> > > > >> > lucasvick...@gmail.com> wrote:
> > > > >> > >>> > I am writing my own c++ basedOAuthlibrary.  I know there
> is
> > > liboauth
> > > > >> > >>> > but I like to do things myself to learn.
> >
> > > > >> > >>> > Anyhow I am trying to accesshttp://
> > > > >> >stream.twitter.com/1/statuses/sample.xml
> > > > >> > >>> > and I keep getting 401.
> >
> > > > >> > >>> > I have verified pretty much every parameter, and used the
> tool
> > > on
> >
> > >http://hueniverse.com/2008/10/beginners-guide-to-oauth-part-iv-signin.
> ..
> > > > >> > >>> > to verify my signature is correct. I used twurl to obtain
> the
> > > user
> > > > >> > >>> > access tokens to my account.
> >
> > > > >> > >>> > After doing some reading I'm no longer convinced that
> > > thestreaming
> > > > >> > >>> > server even supportsoauth.
> >
> > > > >> > >>> > can you fill me in on the current status
> ofstream.twitter.comand
> > > > >> > >>> >oauth?
> >
> > > > >> > >>> > thanks!
> > > > >> > >>> > Lucas
> >
> > > > >> > >>> > On Apr 20, 11:02 pm, Jonathon Hill 
> > > wrote:
> > > > >> > >>> >> Thanks Taylor for the very detailed and helpful response!
> >
> > > > >> > >>> >> Jonathon
> >
> > > > >> > >>> >> On Apr 20, 1:17 pm, Taylor Singletary <
> > > taylorsinglet...@twitter.com
> >
> > > > >> > >>> >> wrote:
> >
> > > > >> > >>> >> > Hi Jonathon,
> >
> > > > >> > >>> >> > ForStreamingAPI access that isn't from the perspective
> of a
> > > user's
> > > > >> > >>> >> > account, you would use two-legged

[twitter-dev] Transitioning from Basic Auth to OAuth Guide (need your help!)

2010-06-25 Thread Taylor Singletary
Hi Everyone,

We've started putting together a document that goes through many of the
things developers need to know about transitioning from Basic Auth to OAuth
(as opposed to coming to OAuth without having the history of basic auth
behind them).

You can find this guide here: http://bit.ly/anYWSC

We're not done yet, and we'd love to hear your suggestions on additions that
could be made to this document, especially if you've made the conversion
yourself and learned some hard lessons along the way.

The document does not go into any specific code implementations, as the
conversion process is very dependent on the particularities of the
programming languages, libraries, and coding styles that pre-exist for the
developer. However, we'd love to collect together specific implementation
stories of developers who've successfully made the transition and highlight
them here.

Do you have something you'd like to add? Respond to this thread!

Thanks everyone,

Taylor Singletary
http://twitter.com/episod


[twitter-dev] Re: Cannot update status with Twitter PHP Library

2010-06-25 Thread Sam Wierema
If you're using Abraham's library you should drop the .json and the
first slash in the call:
$return = $twitter->post( 'statuses/update', array( 'status' =>
'TEST' ) );

If you're using EpiTwitter (not Abraham's library) you should probably
use something like this (according to this:
http://wiki.github.com/jmathai/twitter-async/#methodnames):
$return = $twitter->post_statusesUpdate( array( 'status' =>
'TEST' ) );

On Jun 25, 8:14 pm, Straube  wrote:
> Hi,
>
> I'm trying to update an account status with the Abraham's PHP Library,
> but I'm getting the following exception message:
>
> Bad request / Your browser sent a request that this server could not
> understand.
>
> I've already authorized my application to connect with my test account
> and I saved the authentication data in constants. I'm using the code
> bellow to do the update:
>
> try {
>   $twitter = new EpiTwitter(Config::TWITTER_APP_TOKEN,
> Config::TWITTER_APP_SECRET, Config::TWITTER_OAUTH_TOKEN,
> Config::TWITTER_OAUTH_SECRET);
>   $return = $twitter->post('/statuses/update.json', array ( 'status'
> => 'TEST' ));
>   echo $return->response;} catch (Exception $e) {
>
>   echo $e->getMessage();
>
> }
>
> API methods that uses 'get' instead of 'post' (e.g. account/
> verify_credentials) works without problem.
>
> Thanks in advance.
>
> Straube


[twitter-dev] Re: abrahams twitteroauth issue

2010-06-25 Thread Sam Wierema
Yes, it's very possible. Haven't tested it, but it should be something
like this:

$cursor = -1;
while( $cursor !== 0 ) {
$info = $oauth->get( 'statuses/followers', array( 'cursor' =>
$cursor ) );
if( $oauth->http_code === 200 && !isset( $info->error ) ) {
// Count or whatever here
$cursor = $info->next_cursor;
}
}

If you just want to count all of your followers, why not do users/
show? That contains a followers_count variable in it.

On Jun 25, 4:18 pm, Rick  wrote:
> Thank you for your reply.
>
> I don't use next_cursor or whatsoever. I just use the $followers
> variable to use count it with $totaal = count($followers); so I can
> use it in my code. The cursor code I posted before is the only thing I
> use to try and get information.
>
> Is it even possible to get all the followers with the abrahams twitter
> library?
>
> On 25 jun, 15:11, Sam Wierema  wrote:
>
>
>
> > You should not increment your cursor, because Twitter returns a cursor
> > for you. And if cursor is 0, it means that there are no more pages (-1
> > + 1 = 0).
>
> > Check your $followers variable that you got from the first call. It
> > should be called something like next_cursor.
>
> > On Jun 25, 2:26 pm, Rick  wrote:
>
> > > Howdy!
>
> > > I am currently making my application OAuth compatible from basic auth,
> > > currently I have a issue I need to get resolved in order to switch to
> > > the new OAuth method.
>
> > > I am getting my followers from: $oauth->get('statuses/followers'); but
> > > that only gives me the last 100 followers, I trought it would be easy
> > > to do it this way:
>
> > > $cursor = -1;
> > > $followers = $oauth->get('statuses/followers', array('cursor' =>
> > > $cursor));
> > > // Other code here..
>
> > > $cursor++;
> > > $followers = $oauth->get('statuses/followers', array('cursor' =>
> > > $cursor));
>
> > > Is it possible to get all my users, because this code does not work
> > > and my inspiration was wrong.
>
> > > Hopefully you can help me.
>
> > > Regards,
>
> > > Rick


Re: [twitter-dev] Multiple Resutls for Twitter Place IDS

2010-06-25 Thread Matt Harris
Thanks for the question. The geo docs are being updated at the moment and
we've noticed various bits of them have gone missing, including search.
We're looking into why that is at the moment.

You can directly access the information on the method by visiting:
http://dev.twitter.com/doc/get/geo/search

You can use max_results to limit the number of places which are matched -
just know we have a known issue at the moment where the API sometimes
returns 0 results when max_results=1.
You can also include the query=Staples%20Center to do a place name search

In terms of relevance I assume you mean relevance based on the accuracy of
the name to what you desire. The API does a very simple AND search for each
word in the query you pass it. This means you would need to post process the
results to find what you consider the most relevant one.

Your simple algorithm description sounds like an approach that would work.

Hope that helps,
Matt

On Fri, Jun 25, 2010 at 12:09 PM, ELB  wrote:

>
> I notice that in the example of the Staples Center in Los Angeles, the
> best choice for "Staples Center" is the second result.  We would like
> to automate our script; do you have any suggestions for determining in
> code which of the 5 responses is best?  Meaning, for a given venue,
> Twitter has multiple Place IDS - how can we automate it to select the
> most relevant one?
>
> Just *conceivably* some simple algorithm like (a) ruling out results
> that do not have an exact match somewhere inside the result, and (b)
> then choosing the result that has the *fewest* extra characters
> outside the match, might give good results much of the time.  That is
> one idea - any others?
>
>
>  also, as an aside, we can't find documentation for this geo/search
> API.  Do you know if documentation has been put up yet?
> Specifically, though, is there a way to control the number of results
> - say, to provide 10 results rather than just 5?
>
>


-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


[twitter-dev] Multiple Resutls for Twitter Place IDS

2010-06-25 Thread ELB

I notice that in the example of the Staples Center in Los Angeles, the
best choice for "Staples Center" is the second result.  We would like
to automate our script; do you have any suggestions for determining in
code which of the 5 responses is best?  Meaning, for a given venue,
Twitter has multiple Place IDS - how can we automate it to select the
most relevant one?

Just *conceivably* some simple algorithm like (a) ruling out results
that do not have an exact match somewhere inside the result, and (b)
then choosing the result that has the *fewest* extra characters
outside the match, might give good results much of the time.  That is
one idea - any others?


 also, as an aside, we can't find documentation for this geo/search
API.  Do you know if documentation has been put up yet?
Specifically, though, is there a way to control the number of results
- say, to provide 10 results rather than just 5?



Re: [twitter-dev] Re: Hashtags in prepopulated status's when the user was not logged in

2010-06-25 Thread Matt Harris
Thanks, we've filed this internally. You can follow progress on the bug
through http://code.google.com/p/twitter-api/issues/detail?id=1706

Matt

On Fri, Jun 25, 2010 at 11:16 AM, DiegoVic  wrote:

> Hi Matt,
> We´re with the same problem. Look:
>
> http://twitter.com/home?status=Brasil%20avan%C3%A7a%20em%20primeiro%2C%20mas%20joga%20mal%20e%20irrita%20Dunga%20http%3A%2F%2Fbit.ly%2F9U4ax6%20%23terra
>
> There´s a problem only when the user was not logged in.
>
> Tks a lot.
>
> On Jun 22, 3:56 pm, Matt Harris  wrote:
> > You want to make sure you URL encode the entire status you are sending,
> > including the spaces. That being said the hashtag is dropped so that's a
> bug
> > at our end. Can you file it onhttp://
> code.google.com/p/twitter-api/issuesandi'll pass it onto the
> > team.
> >
> > Thanks,
> > Matt
> >
> > On Tue, Jun 22, 2010 at 10:27 AM, maestrojed
> > wrote:
> >
> >
> >
> >
> >
> > > You can pre-populate a tweet by doing something like:  > > href="http://twitter.com/home?status=Iam asking a question on
> > > stackoverflow">http://twitter.com/home?status=Iam asking a question
> > > on stackoverflow
> >
> > > If you want to use a hashtag you have to urlencode it http://twitter.com/home?status=Iam asking a
> > > question on %23stackoverflow
> >
> > > If the user is not already logged into twitter, once they do log in,
> > > they are redirected to a 404 because of these hashtags. I am sure its
> > > because twitter has to save/pass through this status query string
> > > while you log in.
> >
> > > Any one have suggestions? A hashtag is important to me in this
> > > situation.
> >
> > --
> >
> > Matt Harris
> > Developer Advocate, Twitterhttp://twitter.com/themattharris
>



-- 


Matt Harris
Developer Advocate, Twitter
http://twitter.com/themattharris


[twitter-dev] Re: Hashtags in prepopulated status's when the user was not logged in

2010-06-25 Thread DiegoVic
Hi Matt,
We´re with the same problem. Look:
http://twitter.com/home?status=Brasil%20avan%C3%A7a%20em%20primeiro%2C%20mas%20joga%20mal%20e%20irrita%20Dunga%20http%3A%2F%2Fbit.ly%2F9U4ax6%20%23terra

There´s a problem only when the user was not logged in.

Tks a lot.

On Jun 22, 3:56 pm, Matt Harris  wrote:
> You want to make sure you URL encode the entire status you are sending,
> including the spaces. That being said the hashtag is dropped so that's a bug
> at our end. Can you file it 
> onhttp://code.google.com/p/twitter-api/issuesandi'll pass it onto the
> team.
>
> Thanks,
> Matt
>
> On Tue, Jun 22, 2010 at 10:27 AM, maestrojed
> wrote:
>
>
>
>
>
> > You can pre-populate a tweet by doing something like:  > href="http://twitter.com/home?status=Iam asking a question on
> > stackoverflow">http://twitter.com/home?status=Iam asking a question
> > on stackoverflow
>
> > If you want to use a hashtag you have to urlencode it http://twitter.com/home?status=Iam asking a
> > question on %23stackoverflow
>
> > If the user is not already logged into twitter, once they do log in,
> > they are redirected to a 404 because of these hashtags. I am sure its
> > because twitter has to save/pass through this status query string
> > while you log in.
>
> > Any one have suggestions? A hashtag is important to me in this
> > situation.
>
> --
>
> Matt Harris
> Developer Advocate, Twitterhttp://twitter.com/themattharris


[twitter-dev] Cannot update status with Twitter PHP Library

2010-06-25 Thread Straube
Hi,

I'm trying to update an account status with the Abraham's PHP Library,
but I'm getting the following exception message:

Bad request / Your browser sent a request that this server could not
understand.

I've already authorized my application to connect with my test account
and I saved the authentication data in constants. I'm using the code
bellow to do the update:

try {
  $twitter = new EpiTwitter(Config::TWITTER_APP_TOKEN,
Config::TWITTER_APP_SECRET, Config::TWITTER_OAUTH_TOKEN,
Config::TWITTER_OAUTH_SECRET);
  $return = $twitter->post('/statuses/update.json', array ( 'status'
=> 'TEST' ));
  echo $return->response;
} catch (Exception $e) {
  echo $e->getMessage();
}

API methods that uses 'get' instead of 'post' (e.g. account/
verify_credentials) works without problem.

Thanks in advance.

Straube


[twitter-dev] Re: Streaming API OAuth explanation?

2010-06-25 Thread Wil
Hi John,

Uhh, care to elaborate? I don't quite get what you meant...

Thanks,
Wil

On Jun 24, 11:17 pm, John Kalucki  wrote:
> Aside from the oAuth issue, which others can address, the only valid
> delimited value is length.
>
> -John
>
>
>
> On Thu, Jun 24, 2010 at 7:58 AM, Wil  wrote:
> > I'm getting this response:
>
> > HTTP/1.1 401 Unauthorized
> > Content-Length: 1296
> > Cache-Control: must-revalidate,no-cache,no-store
> > Content-Type: text/html; charset=iso-8859-1
> > Server: Jetty(6.1.17)
> > WWW-Authenticate: Basic realm="Firehose"
>
> >  
> > 
> > 
> > Error 401 UNAUTHORIZED
> > 
> > 
> > HTTP ERROR: 401
> > Problem accessing /1/statuses/filter.json. Reason:
> >     UNAUTHORIZED
> > Powered by Jetty://
>
> > Here's what I POSTed(oauth tokens are filtered out):
>
> > REQUEST: POSThttp://stream.twitter.com/1/statuses/filter.json
> > Authorization: OAuth
>
> > oauth_consumer_key="#",oauth_token="",oauth_nonce="#",oauth 
> > _timestamp="#",oauth_signature_method="HMAC-
> > SHA1",oauth_signature="",oauth_version="1.0",
> > Content-Type: application/x-www-form-urlencoded
> > Vary: Accept-Encoding
> > Connection: close
>
> > source=softwarename&delimited=1&follow=156934710
>
> > On Jun 23, 1:33 am, John Kalucki  wrote:
> > > OAuthshould work fine onstream.twitter.com
>
> > > -John Kaluckihttp://twitter.com/jkalucki
> > > Infrastructure, Twitter Inc.
>
> > > On Tue, Jun 22, 2010 at 10:00 AM, Wil  wrote:
> > > > I'm a bit dumbfounded here...
>
> > > > I've been trying to login tostream.twitter.com usingOAuth
> > > > (particularly, I've been trying to access
> > > >http://stream.twitter.com/1/statuses/filter.json?follow=). I used
> > > > the access keys obtained fromhttps://
> > api.twitter.com/oauth/access_token
> > > > however, I've been getting 401 errors. I've tried basic authentication
> > > > and it works fine.
>
> > > > Does that mean thatstream:statuses/filter is still can only accept
> > > > basic authentication?
>
> > > > Regards,
> > > > Wil
>
> > > > On May 25, 5:51 am, John Kalucki  wrote:
> > > >> We haven't announced our plans for streaming andoAuth, beyond stating
> > that
> > > >> User Streams will only be onoAuth.
>
> > > >> On Mon, May 24, 2010 at 1:57 PM, 140dev <140...@gmail.com> wrote:
> > > >> > Does this mean that the streaming API will also make the switch from
> > > >> > basic authentication toOAuthat the end of June?
>
> > > >> > On Mon, May 24, 2010 at 4:50 PM, Mark McBride 
> > > >> > wrote:
> > > >> > >OAuthis now enabled onstream.twitter.com.  I'll also send a note
> > out
> > > >> > > to the announce list
>
> > > >> > >   ---Mark
>
> > > >> > >http://twitter.com/mccv
>
> > > >> > > On Mon, May 24, 2010 at 12:30 PM, Aaron Rankin 
> > > >> > wrote:
> > > >> > >> Hi,
>
> > > >> > >> Is there an ETA for enablingoauthonstream.twitter.com?
>
> > > >> > >> Thanks,
> > > >> > >> Aaron
>
> > > >> > >> On May 13, 1:11 pm, John Kalucki  wrote:
> > > >> > >>> OAuthis not enabled onstream.twitter.com. You can try on
> > > >> > >>> chirpstream.twitter.com.
>
> > > >> > >>> On Thu, May 13, 2010 at 10:53 AM, Lucas Vickers <
> > > >> > lucasvick...@gmail.com> wrote:
> > > >> > >>> > I am writing my own c++ basedOAuthlibrary.  I know there is
> > liboauth
> > > >> > >>> > but I like to do things myself to learn.
>
> > > >> > >>> > Anyhow I am trying to accesshttp://
> > > >> >stream.twitter.com/1/statuses/sample.xml
> > > >> > >>> > and I keep getting 401.
>
> > > >> > >>> > I have verified pretty much every parameter, and used the tool
> > on
>
> >http://hueniverse.com/2008/10/beginners-guide-to-oauth-part-iv-signin...
> > > >> > >>> > to verify my signature is correct. I used twurl to obtain the
> > user
> > > >> > >>> > access tokens to my account.
>
> > > >> > >>> > After doing some reading I'm no longer convinced that
> > thestreaming
> > > >> > >>> > server even supportsoauth.
>
> > > >> > >>> > can you fill me in on the current status 
> > > >> > >>> > ofstream.twitter.comand
> > > >> > >>> >oauth?
>
> > > >> > >>> > thanks!
> > > >> > >>> > Lucas
>
> > > >> > >>> > On Apr 20, 11:02 pm, Jonathon Hill 
> > wrote:
> > > >> > >>> >> Thanks Taylor for the very detailed and helpful response!
>
> > > >> > >>> >> Jonathon
>
> > > >> > >>> >> On Apr 20, 1:17 pm, Taylor Singletary <
> > taylorsinglet...@twitter.com
>
> > > >> > >>> >> wrote:
>
> > > >> > >>> >> > Hi Jonathon,
>
> > > >> > >>> >> > ForStreamingAPI access that isn't from the perspective of a
> > user's
> > > >> > >>> >> > account, you would use two-leggedOAuthto establish
> > authentication
> > > >> > instead
> > > >> > >>> >> > of basic auth.
>
> > > >> > >>> >> > A two-leggedOAuthrequest is very similar to
> > otherOAuthrequests:
> > > >> > you have
> > > >> > >>> >> > a specific resource you are trying to access, you have some
> > > >> > parameters you
> > > >> > >>> >> > want to pass to that resource, and you have anOAuthconsumer
> > key
> > > >> > andOAuth
> > > >> > >>> >> > consumer secret

[twitter-dev] Re: Streaming API OAuth explanation?

2010-06-25 Thread Wil
Hi,

Sorry it took me a while since I'm using TweetSharp and am stepping
through the (unfamiliar) code.
The moment you said about the signature, I'm suspecting that the
problem is somewhere with that. However, I got this:

POST&http%3A%2F%2Fstream.twitter.com%2F1%2Fstatuses
%2Ffilter.json&delimited%3D1%26follow%3D156934710%26oauth_consumer_key
%3D%26oauth_nonce%3Dtljnew4g283c50gv%26oauth_signature_method
%3DHMAC-SHA1%26oauth_timestamp%3D1277483909%26oauth_token%3D34216267-
QihEsUq7jxULnJzMbn1EC1AliHVkktPXjqgYHw8Zt%26oauth_version
%3D1.0%26source%3Dsoftwarename

"oauth_consumer_key":"##"
"oauth_token":"34216267-QihEsUq7jxULnJzMbn1EC1AliHVkktPXjqgYHw8Zt"
"oauth_nonce":"tljnew4g283c50gv"
"oauth_timestamp":"1277483909"
"oauth_signature_method":"HMAC-SHA1"
"oauth_signature":"ljXbh0wozsHBV6PRowsuZQUHXQs%3D"
"oauth_version":"1.0"
"source":"softwarename"
"delimited":"1"
"follow":"156934710"

which looks almost like yours.

Thanks,
Wil
On Jun 24, 11:59 pm, Taylor Singletary 
wrote:
> Hi Wil,
>
> I can help you with the OAuth component of this. Can you share your
> signature base string for the request?
>
> Here's an example of a few of the steps of a functioning OAuth request
> against this endpoint:
>
> POST body
> source=softwarename&delimited=1&follow=156934710
>
> Signature Base String
> POST&http%3A%2F%2Fstream.twitter.com
> %2F1%2Fstatuses%2Ffilter.json&delimited%3D1%26follow%3D156934710%26oauth_co 
> nsumer_key%3Dri8JxYK2ddwSV5xIUfNNvQ%26oauth_nonce%3DVBOxfmeKM2mgMeou28zK78M 
> Klfrkvc7Wo4Hx8BAkf0%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp% 
> 3D1277394877%26oauth_token%3D819797-torCkTs0XK7H2Y2i1ee5iofqkMC4p7aayeEXRTm 
> lw%26oauth_version%3D1.0%26source%3Dsoftwarename
>
> Authorization Header
> OAuth oauth_nonce="VBOxfmeKM2mgMeou28zK78MKlfrkvc7Wo4Hx8BAkf0",
> oauth_signature_method="HMAC-SHA1", oauth_timestamp="1277394877",
> oauth_consumer_key="ri8JxYK2ddwSV5xIUfNNvQ",
> oauth_token="819797-torCkTs0XK7H2Y2i1ee5iofqkMC4p7aayeEXRTmlw",
> oauth_signature="cLdFEiEy16d2HdWnb5dPBtuxvko%3D", oauth_version="1.0"
>
> How do your values for signature base string differ, if at all? (other than
> the tokens, timestamp, and nonce being different).
>
> Thanks,
> Taylor
>
>
>
> On Thu, Jun 24, 2010 at 8:17 AM, John Kalucki  wrote:
> > Aside from the oAuth issue, which others can address, the only valid
> > delimited value is length.
>
> > -John
>
> > On Thu, Jun 24, 2010 at 7:58 AM, Wil  wrote:
>
> >> I'm getting this response:
>
> >> HTTP/1.1 401 Unauthorized
> >> Content-Length: 1296
> >> Cache-Control: must-revalidate,no-cache,no-store
> >> Content-Type: text/html; charset=iso-8859-1
> >> Server: Jetty(6.1.17)
> >> WWW-Authenticate: Basic realm="Firehose"
>
> >>  
> >> 
> >> 
> >> Error 401 UNAUTHORIZED
> >> 
> >> 
> >> HTTP ERROR: 401
> >> Problem accessing /1/statuses/filter.json. Reason:
> >>     UNAUTHORIZED
> >> Powered by Jetty://
>
> >> Here's what I POSTed(oauth tokens are filtered out):
>
> >> REQUEST: POSThttp://stream.twitter.com/1/statuses/filter.json
> >> Authorization: OAuth
>
> >> oauth_consumer_key="#",oauth_token="",oauth_nonce="#",oauth
> >>  _timestamp="#",oauth_signature_method="HMAC-
> >> SHA1",oauth_signature="",oauth_version="1.0",
> >> Content-Type: application/x-www-form-urlencoded
> >> Vary: Accept-Encoding
> >> Connection: close
>
> >> source=softwarename&delimited=1&follow=156934710
>
> >> On Jun 23, 1:33 am, John Kalucki  wrote:
> >> > OAuthshould work fine onstream.twitter.com
>
> >> > -John Kaluckihttp://twitter.com/jkalucki
> >> > Infrastructure, Twitter Inc.
>
> >> > On Tue, Jun 22, 2010 at 10:00 AM, Wil  wrote:
> >> > > I'm a bit dumbfounded here...
>
> >> > > I've been trying to login tostream.twitter.com usingOAuth
> >> > > (particularly, I've been trying to access
> >> > >http://stream.twitter.com/1/statuses/filter.json?follow=). I used
> >> > > the access keys obtained fromhttps://
> >> api.twitter.com/oauth/access_token
> >> > > however, I've been getting 401 errors. I've tried basic authentication
> >> > > and it works fine.
>
> >> > > Does that mean thatstream:statuses/filter is still can only accept
> >> > > basic authentication?
>
> >> > > Regards,
> >> > > Wil
>
> >> > > On May 25, 5:51 am, John Kalucki  wrote:
> >> > >> We haven't announced our plans for streaming andoAuth, beyond stating
> >> that
> >> > >> User Streams will only be onoAuth.
>
> >> > >> On Mon, May 24, 2010 at 1:57 PM, 140dev <140...@gmail.com> wrote:
> >> > >> > Does this mean that the streaming API will also make the switch
> >> from
> >> > >> > basic authentication toOAuthat the end of June?
>
> >> > >> > On Mon, May 24, 2010 at 4:50 PM, Mark McBride <
> >> mmcbr...@twitter.com>
> >> > >> > wrote:
> >> > >> > >OAuthis now enabled onstream.twitter.com.  I'll also send a note
> >> out
> >> > >> > > to the announce list
>
> >> > >> > >   ---Mark
>
> >> > >> > >http://twitter.com/mccv
>
> >> > >> > > On Mon, May 24, 2010 at 12:30 PM, Aaron Rankin <

Re: [twitter-dev] Looking for Twitter Corpus With Geo-location Information.

2010-06-25 Thread M. Edward (Ed) Borasky

Quoting elahi :


1. I m looking for Twitter Corpus for Geo-location with geo-location
information.
I m analyzing culture of Twitter Users in my Master Thesis.
The idea is to use the terms used by in indians and amercians in
Tweets.

Is there any Twitter Corpus with Geo-location Information?

Mohammad Fazleh Elahi



1. Try InfoChimps - they collect lots of Twitter data and have their  
own API. For academic researchers, they might be willing to reduce  
their rates and they have a free low-end API offering as well.


2. It's not all that hard to collect more data than you can possibly  
use with Twitter's Streaming API. If you're looking for a broad sample  
of all tweets, there's the "sample" stream, which delivers 5 percent  
of all public tweets, selected at random. Keyword search, following  
specific users or delivering all the geotagged tweets within ten  
one-degree location bounding boxes can be done using the "filter"  
stream.


Where are you going to school?





[twitter-dev] Re: abrahams twitteroauth issue

2010-06-25 Thread Rick
Thank you for your reply.

I don't use next_cursor or whatsoever. I just use the $followers
variable to use count it with $totaal = count($followers); so I can
use it in my code. The cursor code I posted before is the only thing I
use to try and get information.

Is it even possible to get all the followers with the abrahams twitter
library?

On 25 jun, 15:11, Sam Wierema  wrote:
> You should not increment your cursor, because Twitter returns a cursor
> for you. And if cursor is 0, it means that there are no more pages (-1
> + 1 = 0).
>
> Check your $followers variable that you got from the first call. It
> should be called something like next_cursor.
>
> On Jun 25, 2:26 pm, Rick  wrote:
>
> > Howdy!
>
> > I am currently making my application OAuth compatible from basic auth,
> > currently I have a issue I need to get resolved in order to switch to
> > the new OAuth method.
>
> > I am getting my followers from: $oauth->get('statuses/followers'); but
> > that only gives me the last 100 followers, I trought it would be easy
> > to do it this way:
>
> > $cursor = -1;
> > $followers = $oauth->get('statuses/followers', array('cursor' =>
> > $cursor));
> > // Other code here..
>
> > $cursor++;
> > $followers = $oauth->get('statuses/followers', array('cursor' =>
> > $cursor));
>
> > Is it possible to get all my users, because this code does not work
> > and my inspiration was wrong.
>
> > Hopefully you can help me.
>
> > Regards,
>
> > Rick


Re: [twitter-dev] Re: Link Wrapping and Favorites

2010-06-25 Thread Taylor Singletary
Will do my best to remember to update the thread, but can't really offer a
timeline at the moment as to when we'll have the code in place for this.

Thanks for being patient!

Taylor

On Fri, Jun 25, 2010 at 6:47 AM, Georgios  wrote:

> Hi Taylor
>
> Thanks for looking into the favorites problem. Can you please update
> this thread once this is resolved so we can test and update our code.
>
> Cheers
> Georgios
>
> On Jun 24, 8:14 pm, Taylor Singletary 
> wrote:
> > The Search API is a much bigger fish to fry :)
> >
> > Rest assured, we're working on it.
> >
> >
> >
> > On Thu, Jun 24, 2010 at 12:10 PM, Manton Reece  wrote:
> > > Thanks Taylor! You're right -- mentions are working fine, it was a bug
> > > on my side.
> >
> > > Glad to hear you're on top of getting entities into favorites too. And
> > > the search API is another one to cover.
> >
> > > On Jun 24, 10:36 am, Taylor Singletary 
> > > wrote:
> > > > Hi Manton,
> >
> > > > I see the entities coming through when I request my mentions
> timeline..
> >
> > > >http://api.twitter.com/1/statuses/mentions.xml?include_entities=true
> >
> > > > Can you verify again that you're not seeing it for the mentions
> timeline
> > > > when you include this parameter?
> >
> > > > Favorites doesn't yet return entities. It's our intention to return
> > > entities
> > > > wherever a tweet is returned; I'll make sure this gets some
> attention.
> >
> > > > Thanks!
> > > > Taylor
>


[twitter-dev] Re: Link Wrapping and Favorites

2010-06-25 Thread Georgios
Hi Taylor

Thanks for looking into the favorites problem. Can you please update
this thread once this is resolved so we can test and update our code.

Cheers
Georgios

On Jun 24, 8:14 pm, Taylor Singletary 
wrote:
> The Search API is a much bigger fish to fry :)
>
> Rest assured, we're working on it.
>
>
>
> On Thu, Jun 24, 2010 at 12:10 PM, Manton Reece  wrote:
> > Thanks Taylor! You're right -- mentions are working fine, it was a bug
> > on my side.
>
> > Glad to hear you're on top of getting entities into favorites too. And
> > the search API is another one to cover.
>
> > On Jun 24, 10:36 am, Taylor Singletary 
> > wrote:
> > > Hi Manton,
>
> > > I see the entities coming through when I request my mentions timeline..
>
> > >http://api.twitter.com/1/statuses/mentions.xml?include_entities=true
>
> > > Can you verify again that you're not seeing it for the mentions timeline
> > > when you include this parameter?
>
> > > Favorites doesn't yet return entities. It's our intention to return
> > entities
> > > wherever a tweet is returned; I'll make sure this gets some attention.
>
> > > Thanks!
> > > Taylor


Re: [twitter-dev] Re: 404 Problem 3 day

2010-06-25 Thread Taylor Singletary
And are you sure you're getting a 404 and not some other error code?

On Fri, Jun 25, 2010 at 4:02 AM, iLyas  wrote:

> thank you Taylor
>
> I'm use this "http://api.twitter.com/1/statuses/home_timeline.json";
>


[twitter-dev] i want develop one application in symbian c++ which will send message to twitter

2010-06-25 Thread rahul makode
Hi all,

i want to develop one application in symbian c++ which will send
message to twitter user

but there is no support for c++ directly

what do i suppose to do

Thanks in advance

bye


[twitter-dev] Re: 404 Problem 3 day

2010-06-25 Thread iLyas
thank you Taylor

I'm use this "http://api.twitter.com/1/statuses/home_timeline.json";


[twitter-dev] Looking for Twitter Corpus With Geo-location Information.

2010-06-25 Thread elahi
1. I m looking for Twitter Corpus for Geo-location with geo-location
information.
I m analyzing culture of Twitter Users in my Master Thesis.
The idea is to use the terms used by in indians and amercians in
Tweets.

Is there any Twitter Corpus with Geo-location Information?

Mohammad Fazleh Elahi


[twitter-dev] Re: abrahams twitteroauth issue

2010-06-25 Thread Sam Wierema
You should not increment your cursor, because Twitter returns a cursor
for you. And if cursor is 0, it means that there are no more pages (-1
+ 1 = 0).

Check your $followers variable that you got from the first call. It
should be called something like next_cursor.

On Jun 25, 2:26 pm, Rick  wrote:
> Howdy!
>
> I am currently making my application OAuth compatible from basic auth,
> currently I have a issue I need to get resolved in order to switch to
> the new OAuth method.
>
> I am getting my followers from: $oauth->get('statuses/followers'); but
> that only gives me the last 100 followers, I trought it would be easy
> to do it this way:
>
> $cursor = -1;
> $followers = $oauth->get('statuses/followers', array('cursor' =>
> $cursor));
> // Other code here..
>
> $cursor++;
> $followers = $oauth->get('statuses/followers', array('cursor' =>
> $cursor));
>
> Is it possible to get all my users, because this code does not work
> and my inspiration was wrong.
>
> Hopefully you can help me.
>
> Regards,
>
> Rick


[twitter-dev] Re: Delete List Member + OAuth Authorization

2010-06-25 Thread Milen


On Jun 24, 5:20 pm, Taylor Singletary 
wrote:
> Hi Milen,
>
> When you're using a DELETE HTTP method, are you sending the id=12345
> parameter on the query string or in a POST body?
>
> It should be in the query string. There's some contention in the universe on
> whether HTTP DELETEs should accept a body. In our case, like many HTTP
> servers, we do not.

That seemed to be the cause of the issue, Taylor. I've now modified
the code to not use a POST body and everything works fine. May I
suggest a better error message from the API in the case that I was
experiencing?

Many thanks,
Milen


[twitter-dev] abrahams twitteroauth issue

2010-06-25 Thread Rick
Howdy!

I am currently making my application OAuth compatible from basic auth,
currently I have a issue I need to get resolved in order to switch to
the new OAuth method.

I am getting my followers from: $oauth->get('statuses/followers'); but
that only gives me the last 100 followers, I trought it would be easy
to do it this way:

$cursor = -1;
$followers = $oauth->get('statuses/followers', array('cursor' =>
$cursor));
// Other code here..

$cursor++;
$followers = $oauth->get('statuses/followers', array('cursor' =>
$cursor));

Is it possible to get all my users, because this code does not work
and my inspiration was wrong.

Hopefully you can help me.

Regards,

Rick