Link to home
Start Free TrialLog in
Avatar of sulTaN
sulTaN

asked on

Reading content from other websites?

I tried searching the web for tutorials and examples of extracting data from other sites and having them displayed on your website, but I was unable to find any thing.

Does anyone have any idea how this can be achieved?
Avatar of KC_Speedball
KC_Speedball

what data do you want?
isn't it enough to link other pages?
anything else isn't easy
Avatar of sulTaN

ASKER

Well, there isn't any specific piece of data that I want at the moment. I want my page to dynamically change as changes are made to the page from which I'm getting the data.
ASKER CERTIFIED SOLUTION
Avatar of VGR
VGR

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
get some other site to a variable like this:

$source = file("http://www.somedomain.com");
or with no linebreaks:
$source = implode('', file("http://www.somedomain.com"));
yes, true too, BUT (again)

$fd = @fopen ($filename, "r");
if ($fd) { // page found
while (!feof ($fd)) {
  $ligne= fgets($fd, 4096);
  // here you can make some parsing on-the-fly, for example to stop on "RADEON 9700 PRO"
  $contents []=$ligne;
} // while blocking read
//  $contents = fread ($fd, filesize ($filename)); non blocking : doesn't work properly
fclose ($fd);


enables me to parse line per line, thus "saving" some processing&reading if I found what I'm searching for at some point.
Provides also the ability to check for an error in accessing the URI
I guess file() doesn't construct an array in memory, but I may be wrong

You also may want to contact a lawyer and have them explain the phrase "Passing off" to you...
excuse-me ?
what does this mean ?
I don't understand "passing off", could you explain with simple English words ?

If you're simply ripping off other people's content without their prior agreement and displaying it on your site then you can be done for simple Copyright infringement.

"Passing off" is where you offer a service or goods or goods of some kind that are so similar to another company's that it would be reasonable to infer some kind of association.

So I take it back: you're more likely to be committing copyright infringement.
ho, I see.
First this has already been discussed.
Secondly I already use this in some sites of mine.
Third the PHP script is exactly in the position of any client's browser and does only get HTML sent by the distant server. It doesn't "aspirate" the distant website, doesn't download (potentially protected) documents and images, etc

I don't see any "copyright infringement" possible ;-)

It depends how you present the data - the difference between passing off and copyright infringment is a little grey, which is why I recommended you see a laywer to explain it.

If you're presenting someone else's data as if it was your own then there is a clear copyright infringement - the data doesn't have to be "secret" in any way.
of course, but WHO suspected that the data was presented as not belonging to their possessors ? :D

I understand your concern , but it has nothing to do (or at least is not always applicable) to this technique.

One more word : it's the MAN who uses badly (wrongly) a technique, device or weapon who's guilty, NOT the technique, device or weapon itself...
oh, by the way, did I answer your question ?
I'm a bit surprised that YOU raise the copyright issue, given that's YOU who asked the question on how to "pump" an other site's data ;-)

Sorry to be perhaps to frank :D