Results 1 to 3 of 3

Thread: Pausing rss scroller-I give up trying to fetch RSS feed.

  1. #1
    Join Date
    Apr 2007
    Location
    in Woodland hills, CA
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pausing rss scroller-I give up trying to fetch RSS feed.

    1) Script Title: scrollerbridge.php

    2) Script URL (on DD): rsspausescroller.zip

    3) Describe problem: my site is freetoiletbrush.com ...the scroller shows up and then ... "I give up trying to fetch RSS feed." displays.

    I got the url_fopen enabled through my server. but still does not work. :>(

    The script that I uploaded is: (thanks for any help)

    <?php

    /*
    ======================================================================
    Pausing RSS Scroller bridge script
    Author: Dynamic Drive (http://www.dynamicdrive.com)
    Created: March 16th, 2006.
    Function: Converts requested RSS feed from lastRSS into JavaScript array
    ======================================================================
    */

    // include lastRSS
    include "lastrss.php"; //path to lastRSS.php on your server relative to scrollerbridge.php

    // Create lastRSS object
    $rss = new lastRSS;
    $rss->cache_dir = 'cache'; //path to cache directory on your server relative to scrollerbridge.php. Chmod 777!
    $rss->date_format = 'M d, Y g:i:s A'; //date format of RSS item. See PHP date() function for possible input.
    $rss->cache_time = 10; //Global cache time before fetching RSS feed again, in seconds.

    // Define your list of RSS URLs- "RSS_id"=> "URL to RSS feed"
    $rsslist=array(
    "cnn" => "http://rss.cnn.com/rss/cnn_topstories.rss",
    "bbc" => "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml",
    "news.com" => "http://news.com.com/2547-1_3-0-5.xml",
    "slashdot" => "http://rss.slashdot.org/Slashdot/slashdot",
    "dynamicdrive" => "http://www.dynamicdrive.com/export.php?type=new",
    );

    //Domains that are authorized to display scroller:
    //Seperate multiple domains each with a comma (",")
    //For example: $allowedDomains="dynamicdrive.com, javascriptkit.com"
    //OR enter a blank string to allow any domain (ie: for RSS feed syndication):
    $allowedDomains="";

    ////Beginners don't need to configure past here////////////////////

    Header("content-type: application/x-javascript");
    $rssid=$_GET['id'];
    $rssurl=isset($rsslist[$rssid])? $rsslist[$rssid] : die("rsscontentdata=\"Error: Can't find requested RSS in list.\"");
    $divid=$_GET['divid']; //ID of DIV scroller

    // -------------------------------------------------------------------
    // checkdomains()- Checks that current site is authorized to display scroller
    // -------------------------------------------------------------------

    function checkdomains($allowed, $referral){
    if ($allowed!=""){
    $found=0;
    $allowlist=split (",", $allowed);
    foreach ($allowlist as $allow){
    $allow=trim($allow);
    $found+=strpos(" ".$referral, $allow);
    }
    if (!$found)
    die("rsscontentdata=\"This domain isn't authorized to show scroller.\"");
    }
    }

    @checkdomains($allowedDomains, $_SERVER["HTTP_REFERER"]); //check if domain is authorized to display scroller

    // -------------------------------------------------------------------
    // outputRSS_JS()- Outputs the "title", "link", "description", and "pubDate" elements of an RSS feed in XML format
    // -------------------------------------------------------------------

    function outputRSS_JS($url, $divid) {
    global $rss;
    if ($rs = $rss->get($url)){
    echo "rsscontentdata.$divid=new Array();\n";
    $i=0;
    foreach ($rs['items'] as $item) {
    echo "rsscontentdata.$divid" . "[$i]={link:\"" . slashit($item[link]) . "\", title:\"" . slashit($item[title]) . "\", description:\"" . slashit($item[description]) . "\", date:\"" . slashit($item[pubDate]) . "\"}\n";
    $i++;
    }
    if ($rs['items_count'] <= 0) { echo "rsscontentdata=\"Sorry, no items found in the RSS file\""; }
    }
    else {
    echo "rsscontentdata=\"Sorry: It's not possible to reach RSS file $url\"";
    // All else fails
    }
    }

    function slashit($what){ //Encode text for storing in JavaScript array
    $newstring=str_replace('&apos;', '\'', $what); //replace those half valid apostrophe entities with actual apostrophes
    return rawurlencode($newstring);
    }

    // ===============================================================================

    outputRSS_JS($rssurl, $divid);

    ?>

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    What happens when you access scrollerbridge.php directly like so?
    Code:
    scrollerbridge.php?id=cnn
    Last edited by thetestingsite; 04-06-2007 at 02:47 AM.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    I just looked into the problem on your site, and have come to the conclusion that the file "lastrss.php" was not uploaded to your server. You must have this on the server in order for the script to function properly. If you do have it on the server; but in a seperate directory, you must specify the location on this line:
    Code:
    include "lastrss.php"; //path to lastRSS.php on your server relative to scrollerbridge.php
    Edit the part in red to point to the location of this file.
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •