Net-Twitter icon indicating copy to clipboard operation
Net-Twitter copied to clipboard

media_ids parameter should accept a list

Open jmacdotorg opened this issue 7 years ago • 1 comments

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.

jmacdotorg avatar Mar 18 '17 03:03 jmacdotorg

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.

semifor avatar Mar 19 '17 01:03 semifor