Subject: | relationship_exists is broken |
relationship_exists is broken and doesn't work. Provide two twitter ids
and you find the URL is constructed incorrectly and the wrong URL is
submitted.
I've included a patch file fixing it.
Subject: | Twitter.pm.patch |
--- /Library/Perl/5.8.8/Net/Twitter.pm 2008-08-13 05:24:20.000000000 +0530
+++ /Users/pankaj/Twitter.pm 2008-11-11 22:02:36.000000000 +0530
@@ -408,13 +408,18 @@
my $url = $self->{apiurl} . "/friendships/exists.json";
$url .= "?user_a=$user_a";
- $url .= "?user_b=$user_b";
+ $url .= "&user_b=$user_b";
- my $req = $self->{ua}->get( $self->{apiurl} . "/friendships/exists.json" );
+ my $req = $self->{ua}->get( $url );
$self->{response_code} = $req->code;
$self->{response_message} = $req->message;
- return ( $req->is_success ) ? JSON::Any->jsonToObj( $req->content ) : undef;
-
+ if ($req->content eq '"true"') {
+ return 1;
+ } elsif ($req->content eq '"false"') {
+ return 0;
+ } else {
+ return undef;
+ }
}
########################################################################