webmaster nigeria.com
Mon, 31 Jul 2000 17:03:53 -0700
I've just moved to the new version of Newsclipper and I'm having BIG
problems with handles that used to work. This is after converting them.
Actually its not really the new format rather that old sequence of commands
don't seem to work anymore.
Can anybody help me with this. I've included the handler, created with
newsclipper 1.22, and a sample newsclipper input file.
--- Output File Start ---
<html>
<head>
<style type="text/css">
<!--
A:Hover {
font-weight : bold;
font-family : Trebuchet MS;
font-size : medium;
color : Red;
font-style : italic;
}
BODY {
font-size : x-small;
font-family : Trebuchet MS;
font-weight : normal;
font-style : normal;
color : Black;
}
TABLE {
font-size : x-small;
font-family : Trebuchet MS;
font-weight : normal;
font-style : normal;
color : Black;
}
-->
</style>
<title>NewsReel</title>
<meta http-equiv="REFRESH" content="300;
url=http://www.nigeria.com/newsreel.htm">
<meta http-equiv="KEYWORDS" content="Nigeria, Nigerian News, Daily,
Politics, Business, National">
<meta http-equiv="DESCRIPTION" content="Nigerian National News From
Nigeria.com">
</head>
<body>
<table width="100%" cellspacing="1" cellpadding="1" border="0">
<tr>
<td>
<!--newsclipper
<input name=cybereaglesnews>
<filter name=limit number=30>
<output name=array numcols=1>
-->
<!--newsclipper
<input name=cybereaglesnews>
<filter name=map filter=hash2string
format='<a target="newswindow"
href="http://www.nigeria.com/cgi-bin/FrameIt.cgi?Url=%{url}&FooterSize=73&Fo
oterUrl=http://www.nigeria.com/footer.html">%{headline}</a>'>
<filter name=limit number=30>
<output name=array numcols=1>
-->
</td>
</tr>
</table>
</body>
</html>
--- Output File End ---
--- Handler Start --
# -*- mode: Perl; -*-
package NewsClipper::Handler::Acquisition::cybereaglesnews;
use vars qw( @ISA $VERSION %handlerInfo );
$handlerInfo{'Author_Name'} = 'webmaster nigeria.com';
$handlerInfo{'Author_Email'} = '[EMAIL PROTECTED]';
$handlerInfo{'Maintainer_Name'} = 'webmaster nigeria.com';
$handlerInfo{'Maintainer_Email'} = '[EMAIL PROTECTED]';
$handlerInfo{'Description'} = <<'EOF';
Cybereagles news feed
EOF
$handlerInfo{'Category'} = 'sports';
$handlerInfo{'URL'} = <<'EOF';
http://www.cybereagles.com
EOF
$handlerInfo{'License'} = 'gpl';
$handlerInfo{'For_News_Clipper_Version'} = '1.18';
$handlerInfo{'Language'} = 'english';
$handlerInfo{'Notes'} = <<'EOF';
EOF
$handlerInfo{'Syntax'} = <<'EOF';
<input name=cybereaglesnews>
EOF
use strict;
use NewsClipper::Handler;
@ISA = qw(NewsClipper::Handler);
# - The first number should be incremented when a change is made to the
# handler that will break people's input files.
# - The second number should be incremented when a change is made that won't
# break people's input files, but changes the functionality.
# - The third number should be incremented when only a bugfix is applied.
$VERSION = do {my @r=('0.1.0'=~/\d+/g);sprintf "%d."."%02d"x$#r,@r};
# --------------------------------------------------------------------------
----
sub ComputeURL
{
my $self = shift;
my $attributes = shift;
my $url = 'http://193.13.80.60/cybernews/main.asp';
return $url;
}
# --------------------------------------------------------------------------
----
# This subroutine checks the handler's attributes to make sure they are
valid,
# and sets any default attributes if necessary.
sub ProcessAttributes
{
my $self = shift;
my $attributes = shift;
my $handlerRole = shift;
# Set defaults here. You can safely delete this function if your handler
has
# no attributes with default values.
# $attributes->{'some_attribute'} = 'default_value'
# unless defined $attributes->{'some_attribute'};
# Verify any attributes you need to here. Output an error and return undef
# if something is wrong.
# unless ($attributes->{somevalue} > 0)
# {
# error "The \"somevalue\" attribute for handler \"HANDLERNAME\" " .
# "should be greater than 0.\n";
# return undef;
# }
return $attributes;
}
# --------------------------------------------------------------------------
----
# This function is used to get the raw data from the URL.
sub Get
{
my $self = shift;
my $attributes = shift;
my $startPattern = 'Latest Headlines';
my $endPattern = '</table>';
my $url = $self->ComputeURL($attributes);
my $data = GetLinks($url,$startPattern,$endPattern);
return undef unless defined $data;
return $data;
}
# --------------------------------------------------------------------------
----
sub GetDefaultHandlers
{
my $self = shift;
my $inputAttributes = shift;
my $returnVal =<<' EOF';
<filter name='limit' number=30>
<output name='array'>
EOF
return $returnVal;
}
# --------------------------------------------------------------------------
----
1;
--- Handler End --
-
If you would like to unsubscribe from this mailing list send an email to
[EMAIL PROTECTED] with the body "unsubscribe newsclipperdevlist
YOUR_EMAIL_ADDRESS" (without the quotes) or use the form provided at
http://www.NewsClipper.com/TechSup.htm#MailingList.