SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2001
    Location
    Boston
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    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 (fakeurl.com is not the actual URL of course)

    http://fakeurl.com/Cablecast/Plugins...ate#06-10-2011

    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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <?php
    // Create a stream
    $opts = array(
    'http'=>array(
    'method'=>"GET",
    '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('http://fakeurl.com/Cablecast/Plugins/WebSchedule/print.aspx?ChannelID=1&Length=21&Buttons=Generate#06-10-2011 ', false, $context);
    ?>


    </body>
    </html>

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

    Warning: file_get_contents(http://fakeurl.com/Cablecast/Plugins...ate#06-10-2011 ) [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('http://fakeurl.com/Cablecast/Plugins/WebSchedule/print.aspx?ChannelID=1&Length=21&Buttons=Generate#06-10-2011 ', 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
    Posts
    550
    Mentioned
    0 Post(s)
    Tagged
    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
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    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

Bookmarks

Posting Permissions

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