Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Quote:
Originally Posted by Eian00
I am asking this because I am sure there is a service on the web that allows you to build a widget that display exactly the data you selected from a remote website..
|
I'm sure there's tons of "widgets" like this all over the web, but you can't build a general script with JavaScript that is allowed to read the content of remote pages. JavaScript is not allowed to do this, for security reasons, the reasoning being, since JavaScript operates in the client (browser), if it were allowed to scrape information from remote pages, it could read information from sites that users could be logged into. This would be very bad.
The script you are thinking of was probably written to get information from a specific site. And it was probably hosted on that site, which means the external site would be able to control its content from the server. Then, if a third party linked to it, they would be allowed access to any content allowed through the API.
If you want to scrape content from a site, you should write a server-side script that does this. Server side scripts create their own HTTP requests instead of using the browser, and aren't subject to the same security restraints as JavaScript.
__________________
I build web things. I work for the startup Please login or register to view this content. Registration is FREE
.
|