Changeset 855
- Timestamp:
- 07/16/08 21:10:29 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ActionStreams/plugins/ASGames/lib/ActionStreams/Event/Games/XboxGamerscore.pm
r549 r855 5 5 use base qw( ActionStreams::Event ); 6 6 7 use Web::Scraper;7 use ActionStreams::Scraper; 8 8 9 9 __PACKAGE__->install_properties({ … … 20 20 sub as_html { 21 21 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>', 23 23 MT::Util::encode_html($event->author->nickname), 24 24 map { MT::Util::encode_html($event->$_()) } qw( score url )); … … 41 41 42 42 $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; 45 45 46 46 $score =~ s/ (?<= \A \d ) (\d*) \z / join q{}, ((q{0}) x length $1) /xmse; … … 48 48 my $item = { 49 49 url => "http://live.xbox.com/member/$ident", 50 score => $score ;50 score => $score, 51 51 identifier => join(q{:}, $ident, $score), 52 52 }; … … 56 56 57 57 1; 58
