Created
February 10, 2011 07:29
-
-
Save turugina/820095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/AnyEvent/Twitter/Stream.pm b/lib/AnyEvent/Twitter/Stream.pm | |
index 34f4539..4ba412c 100644 | |
--- a/lib/AnyEvent/Twitter/Stream.pm | |
+++ b/lib/AnyEvent/Twitter/Stream.pm | |
@@ -154,7 +154,7 @@ sub new { | |
my($handle, $json) = @_; | |
# Twitter stream returns "\x0a\x0d\x0a" if there's no matched tweets in ~30s. | |
$set_timeout->(); | |
- if ($json) { | |
+ if ($json && $json =~ /^{/) { | |
my $tweet = $decode_json ? JSON::decode_json($json) : $json; | |
if ($on_delete && $tweet->{delete} && $tweet->{delete}->{status}) { | |
$on_delete->($tweet->{delete}->{status}->{id}, $tweet->{delete}->{status}->{user_id}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment