0
저는 IRC에서 사용하기 위해 간단한 로봇을 쓰고 있습니다. 이 모듈을 찾았지만 어떤 이유로 든 예제를 따라 갔지만 실제로 검색 할 수는 없습니다.
모듈은 here.
예는 내 코드는 지금까지 내가, 내가 어떤 실수를하고 있지 않다 말할 수404 Net : Google을 사용하는 중에 오류가 발생했습니다.
here.를 볼 수 있습니다 오프를 기반으로 볼 수 있습니다.
디버깅을 사용하도록 설정하면이 출력이 표시됩니다 (디버깅을 사용하여 마지막 행만 가져옵니다).
<p><b>404.</b> <ins>Thatâs an error.</ins>
<p>The requested URL <code>/search/beta2</code> was not found on this server.
<ins>Thatâs all we know.</ins>
404 Not Found at /usr/lib/perl5/vendor_perl/5.8.8/SOAP/Lite.pm line 3720
내 코드;
$msg =~ s/^google//g; # Get query
my $google = Net::Google->new(key => GOOGLE_API_KEY, debug => 1); # Create search instance
my $search = $google->search(); # Build query
$search->query($msg);
$search->starts_at(0);
$search->max_results(100);
$search->filter(0);
$search->results(); # Search google
my $random = int(rand(100));
my $count = 0;
foreach my $result (@{$search->results()})
{
if ($count == $random)
{
$irc->yield(privmsg => CHANNEL, $result->title() || "No Title");
$irc->yield(privmsg => CHANNEL, $result->URL());
}
$count++;
}
오류 메시지가 나타나는 이유는 무엇입니까?
나는 use Net::Google;
과 use SOAP::Lite;
을 얻었고 SOAP 디렉토리를 확인했습니다. Lite.pm은 분명히 있습니다 ... Google은 아무런 도움이되지 않았기 때문에 약간의 손실이 있습니다.
모듈 - 2005 년, 기사 일 수 있습니다. 어쩌면 API가 변경되었습니다. – askovpen
맞습니다. SOAP API는 실제로 오래되었습니다. 오래 전부터 사용 중단되었지만 모두 삭제되었습니다. 이제 더 이상 developers.google.com에서이 사실에 대한 정보를 찾을 수 없습니다. – daxim
오 그래. askovpen과 @daxim에 감사드립니다. Perl을 처음 접했습니다. 나는 보통 자바를 사용하며, 언제나 무언가가 비난 될 때 워드 프로세서는 항상 말을한다. ... – FizzBuzz