×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Pulling newsfeeds from another site (perl)

Pulling newsfeeds from another site (perl)

Pulling newsfeeds from another site (perl)

(OP)
Dear all,

Basically, we are trying to install the perlscript which is shown at
http://guardianunlimited.co.uk/distribution/harvesters/perlscript/0,7192,,00.html

What this does is pull/harvest newsfeeds from the Guardian Unlimited's site.

We would like to integrate the following literature news to our site:

http://www.guardianunlimited.co.uk/Distribution/Artifact_Trail_Block/0,5184,102937-0-,00.html

However, there are no instructions provided for the script and our knowledge of Perl is not great.

It has taken up a lot of our time and we have no other source for help.

Can anybody possibly help us? Please explain the bits of the script we need to customize/edit on this messageboard or by writing to email@litmania.com.

If need be, we would be pleased to renumerate anybody who can help us for their time.

I reckon it wouldn't take anybody more than half an hour to install/ammend the script.

Incidentally, does anybody know of any other company which provides specific literature/book newsfeeds (other than isyndicate)? We'd like one which doesn't show the headlines, but the first paragraph or so of the actual news on our site as well.

Thank you VERY much.

Yours sincerely,
N. Azam
Litmania.com Inc.
http://www.litmania.com

RE: Pulling newsfeeds from another site (perl)

(OP)
I'm not sure exactly what your problem is, but if you explain it a little further, perhaps I can help.

Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
http://www.oac-design.com

RE: Pulling newsfeeds from another site (perl)

Hi,

From a quick reading of the script there seem to be only two lines you need to change:

my %content_to_retrieve = (
   'guardian_news.html'     => 'http://www.guardianunlimited.co.uk/Distribution/[...].html',
   'guardian_tv_radio.html' => 'http://www.guardianunlimited.co.uk/Distribution/[...].html'
);

should read

my %content_to_retrieve = (
   'our_news.html' => 'http://www.guardianunlimited.co.uk/Distribution/Artifact_Trail_Block/0,5184,102937-0-,00.html'
);

Mike
michael.j.lacey@ntlworld.com
Cargill's Corporate Web Site

RE: Pulling newsfeeds from another site (perl)

(OP)
Thanks a million for your help.

I've got it working. See:

http://www.litmania.com/cgi-bin/booksunlimited/pull_news.pl

But I just have one final, small question:

How do I 'refer' to it from the HTML of the page I want to have the newsfeed on? Please provide the exact code.

In other words: what is the code I use in my HTML so that the above news headlines are displayed at, say, http://www.litmania.com/index.html (alongside other stuff on my homepage).

Thank you VERY much.

RE: Pulling newsfeeds from another site (perl)

My pleasure.

Unfortunately I don't know the first thing about Perl and how it works with HTML.... Someone else probably will though.

(Sounds like you need to employ a programmer by the way <smile>, like you didn't know that...)

Mike
michael.j.lacey@ntlworld.com
Cargill's Corporate Web Site

RE: Pulling newsfeeds from another site (perl)

hi,

i have read the script. the script will harvest the news and save it to a html file.

depending on your web server, if your web server supports Server-Side-Include (SSI), you can put the following html tag in your index.html where you want the news to display:

  <!--#include virtual="/path/to/guardian_news.html" -->

your should also rename your index.html to index.shtml to indicate that the file contains SSI statement.




ttest
(: happy programming :)

RE: Pulling newsfeeds from another site (perl)

(OP)
My web server does support SSI. I've tried doing exactly what you told me, but it doesn't work. See:

http://64.176.72.84/booksunlimited/index.html

As you know, the newsfeed is at:

http://64.176.72.84/cgi-bin/booksunlimited/pull_news.pl

I have tried tinkering with the permissions to both the files/URLs, changed the directories, and also tried using the command in my index page, but it doesn't work.

Do you know why this might be?

Thank you very very much.

Nadeem Azam
http://www.litmania.com

RE: Pulling newsfeeds from another site (perl)

You might be able to enable SSI on your local directory by setting the .htaccess file.

Otherwise, I suggest you make index.pl your main index page and use that script to both load your news items and read in your html text.

Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
http://www.oac-design.com

RE: Pulling newsfeeds from another site (perl)

(OP)
Thanks a million for your help Tom. You're an absolute angel!

One final question: I've looked but can't find the .htaccess file. Where would it be?

Sorry, if this is a fairly basic question, but I'm fairly new to this kind of stuff.

Best wishes - and thank you VERY much.

N. Azam
Litmania.com Inc.

RE: Pulling newsfeeds from another site (perl)

Go to the directory that your script is in and create a new file called .htaccess.  Open it up and write the following:

AddType text/x-server-parsed-html .html

close it and chmod 644.

Then add this line to your html file:

<!--#include virtual="/path/to/guardian_news.html" -->

If it doesn't work, then the server administrator has disabled the ability to modify the default settings.

If that's the case, then either do it using perl (index.pl) as I suggested, beg the administrator to give you local permission to do this, or get a new host.

Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
http://www.oac-design.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close