Forum Moderators: coopster & phranque

Message Too Old, No Replies

How can I add the Perl XML::RSS Module to my virtual server?

Web Host has not installed RSS. I want to display RSS Newsfeeds

         

Wizcrafts

11:25 pm on Oct 4, 2004 (gmt 0)

10+ Year Member



Not your run of the mill question, I am pondering the intricicies of adding an RSS feed to my website, which is remotely Hosted. I have chosen to try to implement the rss2html.pl script from Webreference.com. It requires that XML::Parser and XML::RSS Perl Modules be installed on the server. After reviewing all installed Perl Modules, on my CPanel Server, I found that XML::PARSER is installed, but not XML::RSS.

Has anybody in the audience run into this type of problem and solved it with a local Module installation? If so, what type of procedure would I need to follow to install the necessary files from my home Windows machine, into my remote Apache driven web server? As I understand it, most Perl installations use a command line interface, which I don't have access to (no telnet or ssh permissions). I FTP to my website via WS_FTP Pro. I have CGI, PHP and SSI privileges within my own website, but cannot go above my own root folder (no access to the Linux OS).

My shebang statement is: #!/usr/bin/perl
This is used by the rss2html.pl script
If I manage to install the missing RSS module locally, how do I call it from the script?

As you can tell I am not a Guru in Perl, just a user.

Thanks for your bearing with me on this, and any help you may be able to offer me.
Wiz

Wizcrafts

12:53 am on Oct 5, 2004 (gmt 0)

10+ Year Member



I forgot to add the beginning of the rss2html script, where is declares it's includes. They are:

# INCLUDES
use strict;
use XML::RSS;
use LWP::Simple;

Wiz

coopster

1:22 am on Oct 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Most hosting providers will install modules for you upon request. Some also allow you to install your own in your own web space. Have you asked them to install XML::RSS for you?

Wizcrafts

1:30 am on Oct 5, 2004 (gmt 0)

10+ Year Member



Coopster;
I must install it myself, into my own space. The Host will not install it in my user directory, or in the main Perl directories. I am on my own to do this, if I can get it going. Bandwidth is an issue and I must keep the feed small, or not use it at all.

I have been using Javascript includes from a service that is about to go strictly commercial. All of the newsfeeds will be removed in a few weeks, and I am looking to display the ones I want, via XML links to rss files.

Wiz

coopster

9:46 pm on Oct 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



So you have been granted the ability to make/install into your own space, but have been denied the use of a command line? Are you kidding me? They expect you to script everything you want to do? Fun.

Well, perhaps this will get you started...
How do I install Perl modules? [perl.com]

Wizcrafts

5:03 am on Oct 6, 2004 (gmt 0)

10+ Year Member



Thanks for the link to CPAN, Coopster. This will get me started at least. I'll report back here if I am able to install and run the RSS module on my website.

Wiz

cyberws

3:12 pm on Oct 6, 2004 (gmt 0)

10+ Year Member



You can use the BEGIN push method and place the compile module into your script area. If you notice some scripts include the modules in the script base.

1) Download from cpan
2) Decompress and untar
3) run perl Makefile.PL
4) make
5) In your Perl scripts at the top of them:

BEGIN {
push (@INC, "/full/path/to/XML::RSS/Module");
}

==============
This will set the scripts to look for the Perl modules in that location as well as the default/system locations.

Then just use the module as you normal would. Its a simple process.

use XML::RSS

Wizcrafts

3:55 pm on Oct 6, 2004 (gmt 0)

10+ Year Member



cyberws emphatically announced:

BEGIN {
push (@INC, "/full/path/to/XML::RSS/Module");
}

==============
This will set the scripts to look for the Perl modules in that location as well as the default/system locations.

That is precisely what I needed to know, if I am going to go to the trouble of tarring and feathering this Perl Module into my website. Thank you!

Wiz

cyberws

9:06 pm on Oct 6, 2004 (gmt 0)

10+ Year Member



Just thought I would say sometimes the code:

BEGIN {
push (@INC,"/full/path/to/custom/mods");
}

Will create problems due to the quotes thus if you experience this issue simply remove the quotes:

BEGIN {
push (@INC,/full/path/to/custom/mods);
}

Don't forget you can include variables too:

BEGIN {
push (@INC,$custom_path);
}

Our company gets tired of having to setup the same parameters over and over and over thus we have created a general library file and link against it for common vars - like sendmail paths, admin e-mails, etc. It doesn't work for all scripts but it helps with general administration.

flahertyniall

6:03 pm on Nov 4, 2004 (gmt 0)



Hey Wiz, I found this post of yours via google, when looking for info on xml::rss, the reason I was looking was exactly the same as your reason for posting, but that wasn't the last thing I found familiar about what you were saying. I use Netfirms for my Hosting Plan and they have xml::parser but not xml::rss installed, when I asked them to install it they refused. I was wondering if it was netfirms you were dealing with and whether you were succesful with the solution offered by 'cyberws'?

I'd love to know, but wouldn't like to try it out without knowing more - I'm a bit unfamiliar with this type of coding :)

DrDoc

8:10 pm on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The Perl manual recommends a different approach:

use lib '/mypath/libdir/';
use XML::RSS;

claus

8:16 pm on Nov 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



one word: CARP

Added two more: zFeeder + Magpie

- go googling :)

(Yeah, i know it's slightly OT, as it's php, but if you have Perl you probably have php as well - it's right on topic for " intricicies of adding an RSS feed to my website" though.)