Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove duplicate items from args, as twitter throws a wobbly otherwise

  • Loading branch information...
commit e6c591a27e78af13e4b816b2341aab3315f3642e 1 parent 36f8a48
@castaway authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/Net/Twitter/API.pm
View
5 lib/Net/Twitter/API.pm
@@ -55,6 +55,11 @@ sub twitter_api_method {
$args->{$_} = join ',' => @{ $args->{$_} } if ref $args->{$_} eq 'ARRAY';
}
+ # remove remaining duplicates:
+ for ( keys %$args ) {
+ $args->{$_} = $args->{$_}[0] if ref $args->{$_} eq 'ARRAY';
+ }
+
$self->_remap_legacy_synthetic_args($args);
croak sprintf "$name expected %d args", scalar @$arg_names if @_ > @$arg_names;
Please sign in to comment.
Something went wrong with that request. Please try again.