Hi Emmett,
First of all thanks a lot for trying to help me.
The $access_token variable come from the beginning of the script
callback.php of the tutorial and it seems to be correct because i am
using it to retrieve my steam_key which is returned properly.
//We were passed these through the callback.
$token = $_REQUEST['token'];
$token_secret = $_REQUEST['token_secret'];
$consumer = new OAuthConsumer($key, $secret, NULL);
$auth_token = new OAuthConsumer($token, $token_secret);
$access_token_req = new OAuthRequest("GET",
$oauth_access_token_endpoint);
$access_token_req = $access_token_req->from_consumer_and_token
($test_consumer,
$auth_token, "GET", $oauth_access_token_endpoint);
$access_token_req->sign_request(new OAuthSignatureMethod_HMAC_SHA1
(),$consumer,
$auth_token);
$after_access_request = doHttpRequest($access_token_req->to_url
());
parse_str($after_access_request,$access_tokens);
$access_token = new OAuthConsumer($access_tokens['oauth_token'],
$access_tokens['oauth_token_secret']);
$streamkey_req = $access_token_req->from_consumer_and_token
($consumer,
$access_token, "GET", "
http://api.justin.tv/api/
channel/stream_key.xml");
$streamkey_req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(),
$consumer,$access_token);
$after_request = doHttpRequest($streamkey_req->to_url());
//Get streamkey from returned XML
$stream_key = parseStream_KeyFromXML ($after_request);
Until here everything is working fine and i can properly broadcast
using the embedded broadcaster
Regarding the returned values of $end_callback and $callbacks as i
said they are empty; no errors an no values;
Thank you very much your help is very appreciated
On Jul 31, 12:17 am, Emmett Shear <
emmett.sh...@gmail.com> wrote:
> Hi GM -
>
> Unfortunately, Paul was a summer intern who's gone back to school. I'll see
> if I can help you though I don't know much PHP.
>
> Looking at your code, I have a couple questions:
> - In the first line, you use a variable $access_token - what's the flow to
> generate that $access_token?
> - Can you add some print statements to see what the result of $end_callback
> is? And the result of $callbacks?
>
> E
>
> On Wed, Jul 29, 2009 at 5:43 AM, gm <
gianmichele.bartol...@gmail.com> wrote:
>
> > Hi Paul,
> > Thanks a lot for your tutorial; I am completely new to oAuth.php and i
> > can't find much documentation on how to use it with these API.
> > What I am trying to do is to to set a callback to be notified when the
> > broadcasting is finished.
>
> > this is my code
>
> > $end_callback_req=$access_token_req->from_consumer_and_token
> > ($consumer,
> > $access_token, "POST", "
http://api.justin.tv/api/
> > stream /register_callback.xml",array
> > ("channel"=>"my_channel","event"=>"stream_down","url"=>"my_url"));
>
> > $end_callback_req->sign_request(new OAuthSignatureMethod_HMAC_SHA1(),
> > $consumer,$access_token);
> > $end_callback = doHttpRequest($end_callback_req->to_postdata());
>
> > i am then trying to get a list of the registered callbacks using...
>
> > $callbacks_req=$access_token_req->from_consumer_and_token($consumer,
> > $access_token, "GET", "
http://api.justin.tv/api/stream/
> > list_callbacks.xml <
http://api.justin.tv/api/stream/%0Alist_callbacks.xml>