|
-
May 23rd, 2009, 10:43 AM
#1
Thread Starter
Hyperactive Member
getFeed Question
Hi all,
I'm retrieving an XML feed via php:
PHP Code:
<?php
header('Content-type: text/xml');
echo file_get_contents('http://www.somexmlfeed.com/feed.xml');
?>
Now this is working fine and I'm able to work with the XML data to populate my website - this data is only updated when the page is refreshed; therefore I wondered if there was a way I could send out this request every couple of seconds without a page refresh?
Any help much appreciated as I'm struggling with this.
-
May 23rd, 2009, 06:31 PM
#2
-
May 24th, 2009, 03:40 AM
#3
Re: getFeed Question
my initial assumption is that you wanted to update this feed data whether or not your site is actually visited or not. you can make a script that updates it and add it as a scheduled task (windows) or a cron job (unix). to run every minute, or something. running every few seconds would be a little pointless.
but if you actually wanted real time updates on your website, there isn't really any way to efficiently do it that I know of. facebook does something a little like this, but I'm not sure to what extent. if I leave my browser open and come back a few hours later, my "friend feed" will be updated with a link that tells me "X new posts" were posted since my last refresh, which I can then click on and it will run ajax to update the feed. so, yeah, it's probably possible to do real time updates, as well! but, I've not looked into how they do it either.
most sites just put things like that in an iframe, and have it refresh every 10-20 seconds.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|