I need to parse through another site's source code and enter some of its text into my web site. How do I do this and have it update automatically when the original site updates?
3/12/2010 2:03:58 AM
PHP + curl
3/12/2010 3:53:43 AM
Holy shit, it's Tingers.
3/12/2010 7:27:47 AM
perl + cron[Edited on March 12, 2010 at 9:51 AM. Reason : forgot cron]
3/12/2010 9:50:58 AM
PHP > PerlPersonal preference.
3/12/2010 10:28:36 AM
PHP + get_file_contents + preg_replace/preg_match
3/12/2010 10:44:28 AM
Also, a lot of sites get kinda pissy if you do that too much.
3/12/2010 11:09:35 AM
^^ get_file_contents url access is often disabled on shared hosting.go with curl
3/12/2010 11:40:34 AM
yeahPHP + libcurl + the preg functions (or explode, if you're lazy)^^that too. you might want to consider adding some caching logic.]
3/12/2010 11:49:43 AM
It's file_get_contents ( http://us.php.net/manual/en/function.file-get-contents.php ), rooks However, it's the right answer unless (as qntmfred said) it's URL access is disabled.A cron/caching wouldn't be a terrible idea either[Edited on March 12, 2010 at 12:20 PM. Reason : Oh god, I'm too dumb to remember how to link ]
3/12/2010 12:19:35 PM
I'm dyslexic words. Also i broke into your office to watch Duke.Sry.
3/12/2010 12:39:35 PM
Thanks, I will try some of this today.Really, I am not stealing. I am participating in a fundraiser and referencing the original site's current amount of funds raised. I have full permission to do this.
3/12/2010 6:57:06 PM
^^^ aha, i thought it looked a little weird. i've been out of php for a while now
3/13/2010 4:09:51 PM
If you know the people who run the site you're referencing, ask them to set up a page with only the funds raised on it (similar to whatismyip automation page: http://www.whatismyip.com/automation/n09230945.asp)Saves then bandwidth and saves you some work.
3/14/2010 10:12:33 AM
^ With over 10,000 people participating, I really don't think they are going to create a new page just for me, however it would be nice if they did.
3/14/2010 12:14:23 PM
Can't hurt to ask.As others have suggested, you probably want to avoid hitting their page every time someone hits yours.
3/14/2010 2:08:57 PM
iframe dawg
3/15/2010 4:18:55 PM
oh smoothcrim
3/15/2010 4:32:45 PM
Thanks guys, finally got the chance this weekend to mess around with it and got it working.
3/16/2010 11:11:51 AM