Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Rss


  • Please log in to reply
4 replies to this topic

#1 madams

madams

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 504 posts
  • Location:Costa Blanca, Spain

Posted 12 August 2009 - 04:37 PM

Hi

Anyone know of a good RSS feedreader script. I have been looking for one most of the day sad.gif

I have tried one with the same name as above but my host says I cant use it because...

QUOTE
Using include() as that code does is disabled for security reasons, because it can allow malicious users to run arbitrary code on your web site. This could cause serious problems, like deleting your web site files, or putting malware download code on your web pages so people who visit could be infected with viruses.


The code I tried to use for the reader
CODE
<?php
$olderror_reporting =error_reporting(0);
include ("http://rssfeedreader.com/rss3/rss.php?url=http%3A%2F%2Fnews.search.yahoo.com%2Fusns%2Fynsearch%2Fcategories%2Fnews_story_search_rss%2Findex.html%3Fp%3Dfootball&newpage=1&chead=1&atl=1&desc=1&owncss=&eleminate=&auth=1&dts=1&width=500&max=10&tlen=0&rnd=1&bt=3&bs=Double&nmb=&ntb=&naf=&nst=&nwd=0&nht=0&dlen=0&lstyle=-1&lc=%230099FF&bg=White&bc=%23FFFFFF&spc=&ims=1&tc=&ts=11&tfont=Verdana,+Arial,+Sans-serif&rf=".$HTTP_SERVER_VARS['SERVER_NAME'].$HTTP_SERVER_VARS['PHP_SELF']."&phpout=1");
error_reporting($olderror_reporting);
?>


I need one in PHP if anyone can help.

#2 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 12 August 2009 - 07:45 PM

If you're host has php includes disabled you're going to have to find another way to import the info.

Do they have all php includes disabled? Or only off-domain includes disabled? To have both disabled is way, way overkill. To the point that it makes php unusable IMHO.

#3 madams

madams

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 504 posts
  • Location:Costa Blanca, Spain

Posted 13 August 2009 - 03:23 AM

QUOTE
Do they have all php includes disabled? Or only off-domain includes disabled?


Not sure Randy. I am not UP on servers so I dont even know what questions to ask sad.gif

I use "normal" SSI on my site (so that is enabled) but this is the first time I have tried to include a PHP file.

Regarding the feed, I can use JavaScript but the bots dont read it.

Should I be asking my host specific questions to try to find a solution.

Thanks...

#4 1dmf

1dmf

    Keep Asking, Keep Questioning, Keep Learning

  • Active Members
  • PipPipPipPipPipPipPip
  • 2,167 posts
  • Location:Worthing - England

Posted 14 August 2009 - 09:24 AM

if its a *nix hosting do you have perl installed?

If so reading RSS is simple... (filename = mortgage_news.pl)

CODE
#!/usr/bin/perl

######################
# Set Error Trapping #
######################

use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
use warnings;
use strict;
  
#######################
# Use Template Module #
#######################
use Template;        

##################
# Use RSS Module #
##################
use RSS;

##################
# Use LWP Module #
##################
use LWP::Simple;

# Set Vars
my (@mornews,$i, $rss, $url);

$i = -1;

# create new instance of XML::RSS for Mortgages
$rss = new XML::RSS;

# Read current Mortgages XML RSS Feed
$url = "http://www.mortgages.co.uk/news/rss/latest.xml";

$rss->parse(get $url);
                                            
# Loop RSS & create Array
foreach my $item (@{$rss->{'items'}}) {
    $i++;
    $mornews[$i]->{'title'} = $item->{'title'};
    $mornews[$i]->{'link'} = $item->{'link'};
}        
          
# Start template
my $template = HTML::Template->new(  global_vars => 1,
                                            type => 'filename',
                                          source => '/mortgage_news.htm',
                               die_on_bad_params => 0) or die "Cannot open mortgage_news.htm Template file: $!";

# Add variables to Template
$template->param( 'MortgageNews' => \@mornews );        

# print template    
print "Content-type: text/html\n\n";

print $template->output;

exit();
Now that code also makes use of the Template module, but you could get it to print HTML directly from the script.

Also what's great is you can call perl using normal SSI ...
CODE
    <!--#EXEC CGI="/cgi-bin/mortgage_news.pl" -->


depending on server you may need to use the 'include virtual' command rather than the EXEC as SSI is not the same on all platforms.

#5 madams

madams

    HR 5

  • Active Members
  • PipPipPipPipPip
  • 504 posts
  • Location:Costa Blanca, Spain

Posted 14 August 2009 - 09:43 AM

Your a Star 1dmf cheers.gif

I will check it out.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

We are now a read-only forum.
 
No new posts or registrations allowed.