SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2001
    0 Post(s)
    0 Thread(s)

    Pull schedule off server

    Hello.. Let me state right up front how grateful I am for any assistance that anyone can give... I am not a back-end developer...and my knowledge of PHP is pretty basic.

    I have a client with an internal server which they use for scheduling their internal TV broadcasts. We are in process of a doing a complete web overhaul and migrating the web to Wordpress. We will be using Google Calendar (for a lot of reasons) and setting up a bunch of separate calendars for each group.

    The syntax they gave me for the current schedule is as follows ( is not the actual URL of course)

    I have asked them if they can output the string in XML or iCal which import directly into Google Calendar. On the good chance that they cannot export in those formats, anyone have any thoughts as to how I can access this file? I have tried creating a PHP code as follows and tested it on my localhost server:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>

    // Create a stream
    $opts = array(
    'header'=>"Accept-language: en\r\n" .
    "Cookie: foo=bar\r\n"

    $context = stream_context_create($opts);

    // Open the file using the HTTP headers set above
    $file = file_get_contents(' ', false, $context);


    After about 30 seconds of trying to run the file, I get the following error:

    Warning: file_get_contents( ) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\sample-channel-22.php on line 22

    this is line 22:
    $file = file_get_contents(' ', false, $context);

    Bottom Line: What I want is to be able to integrate this into either a Wordpress page or (ideally) a Wordpress sidebar and then be able to have it update on refresh. Am I crazy??

  2. #2
    SitePoint Evangelist speda1's Avatar
    Join Date
    Jan 2002
    0 Post(s)
    0 Thread(s)
    Are you using Apache? The fopen wrappers must be enabled.

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    France, deep rural.
    17 Post(s)
    1 Thread(s)
    Ask if the server has safe_mode turned on, and check that allow_url_fopen in the ini is set to yes.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts