PDA

View Full Version : A quick question; is this possible?



blackbooks
02 Aug 2010, 09:03 AM
Hi guys, I'm new so if I have put this in the wrong place then please move it or whatever you need to do.
What I am trying to do is make a microsite to do a simple task. I want to check stock levels of products in a retail store by using their website (but have the barebones to do that on a microsite). However the problem I am facing is that the way their site is set up I would have to find the product; add it to the basket; proceed to checkout; and then insert postcode to find out if the store has stock.

What I have managed so far is to create a search bar that will redirect me to the product on their website. I was wondering if there was a way I would be able to make the search bar find the product and then tell me stock of it without me needing to add it to basket etc.

Many Thanks.

TheMichael
02 Aug 2010, 10:42 AM
Unless the site has an XML or RSS feed you can leech from, it will require some trickery. Either with complex JavaScript, or a server side scripting language like PHP (the idea being that you load their content quietly and parse it for information, then display parts of it).

Here's an example of a script I made to return the number of google search results for a keyword, using PHP+JavaScript. The parsing might be outdated though, since google made a few changes to their search results.

Fetch Pages Indexed with PHP and JavaScript (http://www.michaelhartmayer.com/php/fetch-google-pages-indexed-using-php-and-ajax/)