semifor / Net-Twitter

A Perl interface to the Twitter APIs
83 stars 37 forks source link

media_ids parameter should accept a list #73

Open jmacdotorg opened 7 years ago

jmacdotorg commented 7 years ago

According to the spec (https://dev.twitter.com/rest/reference/post/statuses/update), the media_ids parameter of the update() call should take a list of media ID strings as its value.

In current Net::Twitter, if you wish only to attach a single piece of media to a new tweet, then you can set media_ids to that media's value as a string, and it works fine. However, if you try to set media_ids to an ArrayRef of any nonzero length (including one), Net::Twitter seems to interpret this as an attempt to refer to a file on-disk, and therefore usually dies with a no-such-file error.

semifor commented 7 years ago

Hey, Josh. Give Twitter::API a try. It's a rewrite of Net::Twitter that's much leaner and I just added the capability you need for media_ids in version 0.0111.

I intend to deprecate Net::Twitter with Twitter::API replacing it. For most usages, it's a drop-in replacement. Just use Twitter::API->new_with_traits (and adjust your traits list) where you currently use Net::Twitter->new.

Have a look at the Migration trait for details about differences between the two distributions.