Changeset 855

Show
Ignore:
Timestamp:
07/16/08 21:10:29 (5 months ago)
Author:
mpaschal
Message:

Fix the xbox stream to make it work righter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ActionStreams/plugins/ASGames/lib/ActionStreams/Event/Games/XboxGamerscore.pm

    r549 r855  
    55use base qw( ActionStreams::Event ); 
    66 
    7 use Web::Scraper; 
     7use ActionStreams::Scraper; 
    88 
    99__PACKAGE__->install_properties({ 
     
    2020sub as_html { 
    2121    my $event = shift; 
    22     return MT->translate('[_1] exceeded <strong>[_2]</strong> gamerscore <a href="[_3]">on Xbox Live</a>', 
     22    return MT->translate('[_1] passed <strong>[_2]</strong> gamerscore <a href="[_3]">on Xbox Live</a>', 
    2323        MT::Util::encode_html($event->author->nickname), 
    2424        map { MT::Util::encode_html($event->$_()) } qw( score url )); 
     
    4141 
    4242    $score = $score->{score}; 
    43     require Scalar::Util
    44     return if !Scalar::Util::looks_like_number($score)
     43    $score =~ s{ \A \s+ | \s+ \z }{}xmsg
     44    return if $score =~ m{ \D }xms
    4545 
    4646    $score =~ s/ (?<= \A \d ) (\d*) \z / join q{}, ((q{0}) x length $1) /xmse; 
     
    4848    my $item = { 
    4949        url        => "http://live.xbox.com/member/$ident", 
    50         score      => $score; 
     50        score      => $score, 
    5151        identifier => join(q{:}, $ident, $score), 
    5252    }; 
     
    5656 
    57571; 
     58