Jump to content

Retrieve information from remote website


nick1

Recommended Posts

Greetings,

I would like to write a PHP script that retrieves some useful information from a remote website.
Here's my current situation:

I have a hyperlink on a webpage that looks like this:

[code]<a href="http://support.dell.com/support/topics/global.aspx/support/my_systems_info/en/details">61W59</a>[/code]

At this moment, when the hyperlink is clicked, the user is taken to this page:

http://support.dell.com/support/topics/global.aspx/support/my_systems_info/en/details

If you look at the phrase between [code]<a>[/code] and [code]</a>[/code], you'll see it is "61W59."
If you paste that phrase into the input box on the dell website you will be able to retrieve some
additional information about "61W59."  The piece of information I am most interested in is under
"Description."  This information tells me the remaining time until the warranty expires.  As you can see,
the warranty for this particular computer expired back in 1997.

Now onto what I want to do.  I want to automate this process by using a PHP script that goes out to
Dell's website, retrieves the warranty information I want about a particular service tag, then displays the
warranty information on my webpage or writes it to a database if I choose to do so.  The problem is
I have no idea how to design such a script.  I just know that I want the script to be simple and efficient.

I have all the service tags on hand.  It would be super if the PHP script could read the service tags
from a separate text file.

Thank you for your time,

*Nick*
Link to comment
Share on other sites

The first step is to get the websites html code and read that into a string.  I would imagine Dell would have some kind of template the follow per product page, so you could weed through the unneccessary code and find the exact text in the page you want.  All of this is done using the preg_match() function.  Thats the basic synopsis... if you are unfamiliar with patterns in PHP, I would read up on it... I wouldnt mind helping you out with it.  Anyways, let me know if this helps you out at all.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.