phpnewbster Posted March 14, 2009 Share Posted March 14, 2009 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 More sharing options...
WolfRage Posted March 14, 2009 Share Posted March 14, 2009 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. Link to comment https://forums.phpfreaks.com/topic/149337-creating-a-unique-search-feature/#findComment-784338 Share on other sites More sharing options...
phpnewbster Posted March 14, 2009 Author Share Posted March 14, 2009 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 Link to comment https://forums.phpfreaks.com/topic/149337-creating-a-unique-search-feature/#findComment-784759 Share on other sites More sharing options...
zq29 Posted March 14, 2009 Share Posted March 14, 2009 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. Link to comment https://forums.phpfreaks.com/topic/149337-creating-a-unique-search-feature/#findComment-784776 Share on other sites More sharing options...
shlumph Posted March 14, 2009 Share Posted March 14, 2009 Hope you have a heavy duty server in order to parse all that xml from those websites more than once a day, LOL. I hope you plan on only having a selected few products, not all of them. Link to comment https://forums.phpfreaks.com/topic/149337-creating-a-unique-search-feature/#findComment-784785 Share on other sites More sharing options...
phpnewbster Posted March 14, 2009 Author Share Posted March 14, 2009 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! Link to comment https://forums.phpfreaks.com/topic/149337-creating-a-unique-search-feature/#findComment-784872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.