. Topicala Page Index Token

A Journal about the experiences I have developing little applications in C#, Perl, Html and Javascript and talking about things new things that I use. Always Geeky; Always Nerdy; Always poor Grammer!

I am a Software Analyst Developer working in Southport, England but living in Liverpool. I develop mainly in C# and ASP.Net. I have been developing comercial software for several years now. I maintain this site (hosted at SwitchMedia UK) as a way of exploring new technologies (such as AJAX) and just generally talking about techie geek issues. This site is developed through a host of Perl scripts and a liberal use of Javascript. I enjoy experimenting with new technologies and anything that I make I host here.

Quick Search

Web www.kinlan.co.uk

Saturday, August 27, 2005

Proxy Script To Yahoo Related Searches

One of the other features that my AJAX application had was Related Searches. This API connected to the Yahoo API and performed a query. The query is a single search term; the results are searches that a User could perform to get similar results.

For instance if you were to put the keyword "Kinlan" into the API, it might bring back searches that would related to "Kinlan", so "Funky Person, Cool Dude and Amazing Geeza" might be some of the searhes that would also relate to the topic of Kinlan.

This is quite a handy little thing, because you can link it in with my previous entry to bring back all the related searches to all the keywords are provided.

The idea was to allow me to specify some searches that would allow the reader to target related topics and subjects through a search engine such as MSN, Google or Yahoo

Anyway, here is the code.



#!/usr/bin/perl

use LWP;
use CGI qw(:standard);
$CGI::POST_MAX=1024 * 100; # max 100K posts

my($qCGI) = new CGI();
my($YahooAppID) = "APPIDHERE";
my($baseUrl) = "http://api.search.yahoo.com/
WebSearchService/V1/relatedSuggestion"
;

my($query) = $qCGI->param('query');
my($finalUrl) = $baseUrl

$ua = LWP::UserAgent->new;
$ua->agent("YahooPassThrough/0.1 ");

# Create a request
my $req = HTTP::Request->new(POST => $finalUrl);
$req->content(
"appid=$YahooAppID&query=$query&results=50"
);

# Pass request to the user agent
and get a response back
my $res = $ua->request($req);

print "Content-type: text/xml\n\n";
print $res->content;



Technorati Tags
[feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed], [feed]

Comments: [Add New]

Feedster 500 From the Land of Blog Make Believe
Coming in at no.. 6 is the NowPublic news site, not the NowPublic main url but rather the news portion of the site.
Great Blog! If you have time see my ##home based business## related site. enjoy!

By Anonymous, at Saturday, August 27, 2005 3:26:00 PM

A bloggers convention this weekend in Albemarle
UVA's Sorensen Institute is hosting a convention of bloggers this weekend. Bloggers, or web loggers, maintain a form of online diary that often contains criticisms or comments about political candidates and ...
Great Blog! If you have time see my ##business opportunities## related site. enjoy!

By Anonymous, at Saturday, August 27, 2005 3:44:00 PM