How to fetch top 20 results of particular keyword from AOL Search Engine using PHP?

968 views Asked by At

I want top 20 results of AOL search engine but I don't know how can I get using PHP script ?

Please Help me.

2

There are 2 answers

0
Priyank Bolia On

AOL has API to do that: You need to check the docs, like I got one example on internet for ASP.NET: http://dev.aol.com/aspnet-aolvideo-part1

2
codaddict On

First encode the search keyword:

$query = urlencode("YOUR_SEARCH_KEYWORD");

Next construct the URL in the following format:

$URL = "http://search.aol.com/aol/search?query=$query";

And then fetch the page for this URL using file_get_contents() function:

$file = file_get_contents($URL);

This page has 10 results, to get the next 10 results just change the url as:

$URL = "http://search.aol.com/aol/search?query=$query&page=2";

Fetch the file again and this has the next 10 results.