Jump to content

Creating a unique search feature


phpnewbster

Recommended Posts

  I have a website concerning movies and books and I would like to ad a search feature to it. I would like to have a search box where a user can select books or movies, type their search, and have the query check a couple different sources for the cheapest available book or movie, and then have them be able to click the link to get the product. For instance:

 

  Search: (movies) "American Psycho"

 

 

  Results:    Amazon:      $12.99

                  Overstock:  $10.99

                  Other site:    $11.00

 

A few people have told me there are scripts available for this already, but I haven't had any luck. Any help would be great!

 

Thanks,

phpnewbster

Link to comment
https://forums.phpfreaks.com/topic/149337-creating-a-unique-search-feature/
Share on other sites

Doing a search like this dynamically each time could be time consuming, like long enough that you might time out the user on the other end. I would suggest creating a database that is backed by hourly crons. The crons can do the searches for price updates and they can even search for new entries made by users. Then your search can just check your database which will return results rapidly, as compared to crawling the web. For those users that enter a new search term I would build a script dedicated to searching out an answer as fast as possible. But I would give the user a page letting them know that we are checking for them. Then I would use AJAX and Sessions to let the user know once the script has finished, and allow them to view the results at that time.

That sounds even more time consuming. Can't a script be made that just plugs the parameters in for the user. So if they search for the book "Entangled Minds" the script runs a search on Amazon, Borders, and Barnes and Noble and returns the results. The idea sounds simple to me, I just don't know how to do it  :-\

 

 

  Thanks!

  phpNewbster

What you're describing is usually combined with affiliate marketing. When someone clicks a link on your site, through to Amazon, you get a commission for any sale that takes place. With affiliate marketing, the merchants generally provide their affiliates with product feeds - Usually in XML.

 

Then, along the lines of what WolfRage was hinting at, you parse this feed on a daily basis, store it in a local database and use that for your searches.

 

Although, if you want to do it your way, I'd look into cURL.

I much rather not store the information on my data bases. I'll look into the affiliate marketing idea and cURL.

I've been on other sites where searches like this were available, so I know it's sometimes done, but when I contacted

the webmasters, they were not inclined to help me.  :(

 

 

thanks for the help!

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.