I've made a handler to get the new .rpm files from rpmfind.net. I'm just a
perl newbie, so this may not be so generic as you may wish, but it fits my
needs. So here it goes:




# -*- mode: Perl; -*-

# AUTHOR: Mario Moreira
# EMAIL: [EMAIL PROTECTED]
# ONE LINE DESCRIPTION: new rpm packages at rpmfind.net
# URL: http://rpmfind.net/RPM
# TAG SYNTAX:
# <input name=rpmfind>
# LICENSE: GPL
# NOTES:

package NewsClipper::Handler::Acquisition::rpmfind;

use strict;
use NewsClipper::Handler;
use vars qw( @ISA $VERSION );
@ISA = qw(NewsClipper::Handler);

# DEBUG for this package is the same as the main.
use constant DEBUG => main::DEBUG;

use NewsClipper::AcquisitionFunctions qw( GetHtml );

$VERSION = 0.1;

#
----------------------------------------------------------------------------
--

# This function is used to get the raw data from the URL.
sub Get
{
  my $self = shift;
  my $attributes = shift;

  my $url = 'http://rpmfind.net/linux/RPM/ByDate.html';

  my $startPattern = '<h2>RPMs less than three days old</h2>';
  my $endPattern = '<h2>RPMs less than one week old</h2>';

  my $data = GetHtml($url,$startPattern,$endPattern);
  return undef unless defined $data;

  return $data;
}

#
----------------------------------------------------------------------------
--

sub GetDefaultHandlers
{
  my $self = shift;
  my $inputAttributes = shift;

  my @returnVal = (
    {'name' => 'string'},
  );

  return @returnVal;
}

#
----------------------------------------------------------------------------
--

sub GetUpdateTimes
{
  return ['9'];
}

1;


--
Mario Moreira
Portugal Telecom Inova��o
+351 34 403200

-
If you would like to unsubscribe from this mailing list send an email to 
[EMAIL PROTECTED] with the body "unsubscribe newsclipperlist 
YOUR_EMAIL_ADDRESS" (without the quotes) or use the form provided at 
http://www.NewsClipper.com/TechSup.htm#MailingList.

Reply via email to