Skip to content

Commit

Permalink
Merge pull request #4 from firesock/master
Browse files Browse the repository at this point in the history
Correctly check if there is a response from server for tweet links
  • Loading branch information
marksteward committed Feb 16, 2014
2 parents 49355ff + b00c4b6 commit b0e203a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions earl.pl
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ sub get_tweet {
@text_array[$indices[0]..($indices[1] - 1)] = @replace_array;
$text_array[$indices[0]] = $ent_url;

next unless my (undef, $ent_response) = get_simple_response($ent_url);
push(@text_array, (" > ", $ent_response));
my (undef, $ent_response) = get_simple_response($ent_url);
push(@text_array, (" > ", $ent_response)) if $ent_response;
}
}

Expand All @@ -214,8 +214,8 @@ sub said {
for $url ( list_uris( $args->{body} ) ) {
next unless $url =~ /^http/i;

if ( my ($url, $reply) = get_response( $url ) ) {
next unless $url and $reply;
my ($url, $reply) = get_response( $url );
if ( $url and $reply ) {

# Sanitise the reply to only include printable chars
$reply =~ s/[^[:print:]]//g;
Expand Down

0 comments on commit b0e203a

Please sign in to comment.