Download html source code using a PHP file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ykarmi
Forum Commoner
Posts: 35
Joined: Mon Oct 30, 2006 4:45 pm

Download html source code using a PHP file?

Post by ykarmi »

Hey guys!
Here's what I want to do:
I want to create an RSS feed (for self-usage) for a website I do not own - what I intend to do - is download the source code from the website I want to information from - and then run a replace string to <a href=""> on there and replace it with xml tags that will be readable as an RSS feed.
In order to do that, I need to download the source code of the page - dynamically (since it changes every few minutes) - how is that done?
Thank you very much,
ykarmi :D
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You mean, each time the page is loaded, or cron?

And, you need to know how to get the HTML? Wouldn't you just open the file? I've never tried it, but I assume that's how it'd be done.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I hope you have permission from the site owners to use their content :?

Reguardless, file_get_contents() should help
Post Reply