Getting certain infomation and linking it to yours is it possible

stesouthby

New Member
Messages
115
Reaction score
0
Points
0
hey guys how you all doing I was wondering is it possible to link certain infomation from one website say like price to another website so if that price changes so does yours? so you have a direct link the website the infomation is already on is using php and by the look of thier code it is static and they update there prices manually.
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
You could probably do this by loading their page into a string variable with file_get_contents and then running a regex to find the tag containing the price based on the basic template for the item page. However, a lot of sites probably won't like you doing this, at least not without first obtaining proper permission to do so.
 

bhupendra2895

New Member
Messages
554
Reaction score
20
Points
0
Yes you can do it, this idea came in the mind of web developers and they developed some new techniques through which two websites can talk.That's what we call web 2.0.Now how to do this?

There are lot of ways.But it is always better to sign up with the service you want to use.For example Amazon offers books store information to other websites for free.For using this you need to sign up with Amazon as developer and get a API key and a API.This API can be used with any of the programming languages because it recieves XML.Similar services are offered by google and they have powerful php support in form of zendgdata. Some sites offers php api using curl() and fsock().These can be risky unless you know you can trust the site.Another way is to read RSS and extract the information, RSS feeds are in xml format, so they can be used to get such info using any language.It is a worse idea to open a website page with your program in background and then parse it to get the price.This will be waste of bandwidth of your and siteowner and as well as may fall under copyright violation.

Edit:- You wrote, it is static which I couldn't see on my mobile phone.So then you have to do what lemontree told you.
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Years ago it was called "scraping".
As mentioned, it is best if you are getting it off of a site that welcomes it and has some sort of feed you can use.

Methods depend on the volatility and diversity of information. Are you talking about stock prices? Or something that does not change that often?

Needs to be updated every call to your webpage? You can make the external request every time, but then you are at the mercy of the other website. If they are slow in responding to your request, your page is slow.

Or can it be updated once a day/hourly? You can run a cron job and store the information in a file and have your PHP/Perl script access that.
 
Top