Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i get data from other sites..

Status
Not open for further replies.

slurpyx

Programmer
Joined
Aug 1, 2002
Messages
59
Location
PH
Question..

URL:
I need to get the name of the establisment and the address of the establishment on that url and store it on an array..

example data:
ABC Net Café
California, USA

something like..

foreach (){
echo name;
echo address;
}


is this possible?
 
First use either fopen or curl to read the data into your script.

Then parse that data, possibly with regular expressions, depending on how they supply that data. While parsing, put it into an array.

And yes, it's possible.
 
I prefer not to revive the role of ethicist but while it is technically possible, you should check with the site owner to see if they will legally allow your connection to their site.

See
Grabbing some data may not be an issue and fall under 'fair use' - - - but things are different if you intend to rip the entire site at once or repeatedly through your PHP script.


- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
 
I think we know where this is heading.....
 
Perhaps the word 'ethicist' should not have been used since it may be a foreign concept to some.

The one thing for a programmer to recognize (with or without regard for copyright law) is that some web sites employ safeguards to prevent leeching. Running fopen or curl[i/] on an external site without making arrangements with the source site's publisher may be treated as a DoS attack and the source site may deny your connections, making your script fail. This is bad programming on the part of anyone wanting to 'get data from other sites', regardless of copyright law or ethics.

- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
 
Yeah, permission is nice. Sueing your pants off, may not be though.

___________________________________
[morse]--... ...--[/morse], Eric.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top