bossfighter API
---------------
This script allows you to compare two terms and find out how many search
results can be found for them in Yahoo. You have several URL parameters:
t1: the first term (needs to be words and spaces, everything else
is filtered out)
t2: the second term (needs to be words and spaces, everything
else is filterd out)
callback: the name of a JavaScript method to wrap the JSON return in -
JSON-P I guess you can call it.
format: If format is set to html the API returns a text string. If
it isn't set, it returns a JSON object with a JavaScript header.
This allows you to use this script as a form action (with a
hidden for field called format) and override this normal
behaviour with JavaScript.
The JSON output has the following properties:
winner: The term that had more search results than the other.
winnervalue: The amount of serarch results of the winner.
loser: The term that had less search results than the other.
loservalue: The amount of serarch results of the loser.
by: The difference in search results between winner and loser.
If you want to use this script in a very easy fashion with JavaScript,
check out bossfighter.js, too.
Try this:
* bossfighter.php?t1=smurfs&t2=lettuce&callback=yay
* bossfighter.php?t1=pig&t2=lipstick&format=html
* bossfighter.php?t1=earth&t2=flying saucers&callback=scifi
Chris