Jump to content
  • Advertisement
Sign in to follow this  
ed209

[web] Reading and printing pages from other servers

This topic is 4047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to read and display the html from pages from other servers using open or whatever else I must use. First of all, is something like this possible? And if it is, are there any modules that I will need? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by ed209
I want to read and display the html from pages from other servers using open or whatever else I must use. First of all, is something like this possible? And if it is, are there any modules that I will need?
Yes, it's certainly possible. You just open a socket to the remote server, send a HTTP request to get the page, then echo whatever comes in on that socket.

What language are you using?

And why do you want to do this? There's a strong chance that this will be illegal...

Share this post


Link to post
Share on other sites
Hi.

I'm using perl. My friend has a database for scores for a game and I want my aimbot to be able to display them so the members of the league can see their score anytime they like.

Is something like this possible in Perl considering I don't have access to the cgi database because I don't know how to install modules on a server?

Share this post


Link to post
Share on other sites
Assuming you have permission from the owner of the other site to syndicate their content, and a guarantee that they won't change their site in a way which breaks yours (this would be VERY easy for them to do accidentally, e.g. just rename their pages), you can do it easily technically.

For example, in Perl you could use LWP to download the contents, then process it appropriately (e.g. parse the HTML, extract parts you want) and use it to generate your own pages.

You should note that if you do this without permission and an agreement from the site owner, you are likely to both annoy them, be violating their copyright AND risk breaking your own site horribly.

The owner of the page, when they discover you're scraping it, could configure their web server to serve you something different from what the public see - which could be offensive, defamatory, and get you into a lot of trouble for having it on your site.

Equally they could return some HTML code which breaks your site technically, perhaps including javascript to redirect your users somewhere else. They could even attempt to exploit your code if it allows arbitrary HTML or javascript.

---

Assuming you DO have permission and agreement from the site owner, it would be much safer to get them to provide a machine-readable feed of the data anyway. This would be much more robust than relying on screen-scraping.

Mark

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!