Subject: | Can't get request token |
Hi,
I'm trying to use the module to connect to Yahoo APIs. I have written some code based on the example, but I get an error trying to get the request token.
It's looking like it has trouble connecting to the login host. I edited Yahoo.pm to dump the response and it looks like this:
'_content' => '<HTML>
<HEAD>
<TITLE>Could Not Connect</TITLE>
</HEAD>
<BODY BGCOLOR="white" FGCOLOR="black">
<H1>Could Not Connect</H1>
<HR>
<FONT FACE="Helvetica,Arial"><B>
Description: Could not connect to the requested server host.
</B></FONT>
<HR>
</BODY>
(I've left out the rest as it seems to include the account details)
The error from the module is:
_make_oauth_request() did not receive a good response at test-yahoo.pl line 20.
I've attached my non-working code with the login details removed.
Subject: | test-yahoo.pl |
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::OAuth::Yahoo;
my $args = {
consumer_key => "",
consumer_secret => "",
signature_method => "HMAC-SHA1",
nonce => "random_string",
callback => "oob",
};
my $oauth = Net::OAuth::Yahoo->new($args);
print "OAuth: $oauth\n";
my $request_token = $oauth->get_request_token();
if (!defined($request_token)) {
die $Net::OAuth::Yahoo::ERRMSG;
}
print "Request Token: $request_token\n";
my $url = $oauth->request_auth($request_token);
my $url = $oauth->request_auth();
print "URL: $url\n";
my $yid = {
login => "",
passwd => "",
};
my $oauth_verifier = $oauth->sim_present_auth($url, $yid);
print "OAuth Verifier: $oauth_verifier\n";
my $token = $oauth->get_token($oauth_verifier);
print "Token: $token" . "\n";