Permalink
Browse files

Merge branch 'master' into test

  • Loading branch information...
2 parents 5a51122 + 9f5a7b5 commit 0bc68b51a0409bd4122015bd62ce8340ee1e59a5 @FreekKalter committed May 22, 2012
Showing with 9 additions and 9 deletions.
  1. +9 −9 lib/WWW/Scraper/F1.pm
View
@@ -44,18 +44,15 @@ sub get_upcoming {
}
sub get_top {
- my %options = @_;
+ my $options = shift;
+ $options->{points} = $options->{points} || "yes";
+ $options->{length} = $options->{length} || 5;
my $total_info = &get_info;
my $championship_table = $total_info->{'championship_info'};
- my ( $top_length, $points) = @_;
my $output = '';
- #some defaults
- my $length = $options{top_length} ? $options{top_length} : 5;
- my $points_display = $options{points} ? $options{points} : 'yes';
-
- for ( my $i = 1 ; $i <= $length ; $i++ ) {
- given ($points_display) {
+ for ( my $i = 1 ; $i <= $options->{length} ; $i++ ) {
+ given ($options->{points}) {
when (/no/) {
$output .= sprintf( "%d %-20s\n",
$i, $championship_table->[$i]->{'driver'} );
@@ -191,4 +188,7 @@ WWW::Scraper::F1
=head1 SYNOPSIS
-Scrape info for upcoming race and current championship from formula1.com.
+ use WWW::Scraper:F1;
+
+ print get_upcoming_race([length => 5 , points => just]);
+

0 comments on commit 0bc68b5

Please sign in to comment.