[twitter-dev] streaming API help (regular API works)

2010-08-08 Thread ianrose
Hi -

I hope I am not posting a question that has previously been answered -
I tried searching the archives but to no avail.

I am trying to get the 'sample' stream API working but am getting 401
Unathorized errors.  For debugging purposes, I am using curl for now.
The following command fails (401):

curl 'http://stream.twitter.com/1/statuses/sample.json?
delimited=length' -H 'Authorization: OAuth realm="Twitter API",
oauth_nonce="24599946", oauth_timestamp="1281319798",
oauth_consumer_key="", oauth_signature_method="HMAC-SHA1",
oauth_version="1.0", oauth_token="175905996-
JkrGAl8ZXCgIjeZl3o7fMCD8HbyfVeDbkP9Y13mX", oauth_signature="i
%2BVzWX23sp5t8%2Fz0swJl%2FDHloOo%3D"'


However, I believe that my OAuth stuff is (hopefully) correct because
the following command works, where I have reused the exact same OAuth
header (all I changed was the URL):

curl 'http://api.twitter.com/1/statuses/user_timeline.json' -H
'Authorization: OAuth realm="Twitter API", oauth_nonce="24599946",
oauth_timestamp="1281319798", oauth_consumer_key="",
oauth_signature_method="HMAC-SHA1", oauth_version="1.0",
oauth_token="175905996-JkrGAl8ZXCgIjeZl3o7fMCD8HbyfVeDbkP9Y13mX",
oauth_signature="i%2BVzWX23sp5t8%2Fz0swJl%2FDHloOo%3D"'


So what does this mean?  Are the authentication requirements at all
different for these two API calls?  In case its relevant, note that I
am using my account's "single access token" to create these OAuth
signatures as opposed to a "real" customer key/secret pair.  Any
suggestions on what else I can do to try and debug this?

Many thanks!
- Ian


[twitter-dev] Streaming API Help

2009-09-19 Thread Greg

I'm trying to implement Streaming API on my Twitter application to
enhance the stabilty instead of using the Search API.

Basically - I'm trying to use the track paramter to track a keyword.
However, when I run this code - it just times out - nothing occurs.
Perhaps I'm not using the track parameter correctly?

I know I'm just dumping the code right now - but it was merely for
test.

My ad-hoc code is below:

// twitter_stream.php
http://username:passw...@stream.twitter.com/1/statuses/
filter.json?track=ttl,wine", "r");
while($data = fgets($fp))
{
$new_data = json_decode($data);

foreach($status as $new_data)
{
var_dump($status);
echo "";
}
}
?>

Thanks for the help!

Greg


[twitter-dev] Streaming API Help

2009-09-14 Thread Greg

I've recently been given access to Streaming API - and I was given
access to the "gardenhose" - however it is not listed on the Streaming
API Documentation Website (http://apiwiki.twitter.com/Streaming-API-
Documentation). Is anyone aware of the documentation for this API
call?

I am specifically looking to use it to get tweets with certain text in
them - however should I be using the status/filter API? (http://
apiwiki.twitter.com/Streaming-API-Documentation#statuses/filter)

Any help on examples of these two APIs (PHP) would be helpful.

Thanks,
Greg