Rss help please

Discussion in 'XML & RSS' started by funnel, Nov 3, 2006.

  1. #1
    I have an Godaddy linux host and have try to insert some rss to my sites, I use this code on my php file

    <?php
    function parse_rss1($f) {
    error_reporting(16);
    $xmlfile = fopen($f, 'r');
    if (!$xmlfile) return('RSS Feed down');
    $readfile = fread($xmlfile ,80000);
    $parsefile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
    $filechunks = explode("<item>", $arrayreg[0]);
    $count = count($filechunks);
    echo '<font face=verdana>';
    for($i=1 ; $i<=$count-1 ;$i++) {
    ereg("<title>(.*)</title>",$filechunks[$i], $title);
    ereg("<link>(.*)</link>",$filechunks[$i], $links);
    ereg("<description>(.*)</description>",$filechunks[$i], $description);
    echo str_replace('hxaxh','a',"<font style='font-size: 12px;'><hxaxh target=_blank href ='$links[1]'\>".utf8_decode($title[1])."</hxaxh></font>");
    echo "<br><font color=gray style='font-size: 10px;'>".utf8_decode($description[1])."</font><BR>";
    }
    }
    //
    $xmlfeed = 'http://www.swedehost.com/backend.php';
    parse_rss1($xmlfeed);
    ?>

    But the rss dont show up, I have try to upload the sites on serval other host and there work it fine, I ask Godaddy they tell me this:

    Thank you for contacting online support. I apologize for the inconvenience. Please make sure you are using our proxy server for this issue. You may use the following article for more assistance with the scripting:

    http://help.godaddy.com/article.php?article_id=288&topic_id=&&

    Also note that our proxy server is http://64.202.165.130:3128

    and this is what the article say:

    Below is a PHP script that uses CURL to obtain data from a remote system (http://www.paypal.com) and then creates a Web page based on that data.

    <?

    $URL="https://www.paypal.com";
    if (isset($_GET["site"])) { $URL = $_GET["site"]; }
    $ch = curl_init();
    echo "URL = $URL <br>\n";
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    //curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
    curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
    curl_setopt ($ch, CURLOPT_PROXY,"http://64.202.165.130:3128");
    curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt ($ch, CURLOPT_URL, $URL);
    curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
    $result = curl_exec ($ch);
    echo "<hr><br>\n";
    echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>';
    echo "<hr><br>\n";
    curl_close ($ch);
    print "result - $result";
    echo "<hr><br>\n";

    ?>

    I am not sure what I shall do with this, can any body help me here ??
     
    funnel, Nov 3, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sounds like the main server has a firewall to stop you connecting to external sites. They have added a proxy server so you can connect via that to the third party sites.

    Have you tried their script? Does it work?

    If so you just need to use parse_rss1($result);
     
    mad4, Nov 3, 2006 IP