On Mon Feb 08 16:44:12 2010,
http://id.bandsal.at/al/ wrote:
Show quoted text> Instead it expects a single parameter $image, containing the binary
> image data. Passing that, no error occurs, but the profile image isn't
> actually updated.
For clarification, no, it does not expect the binary image data.
All Net::Twitter methods accept a hashref of named parameters. When a
method has only one required parameter, as a convenience, the value can
be passed as the first parameter to the method.
That's what's broken in this case---the convenient, short form isn't
recognizing the value as it should. So, falling back to the hashref of
named parameters works.
update_profile_image has a single required parameter: image. So it can
be called with:
$nt->update_profile_image({ image => $image_value })
where, $image value is an arrayref, as described in the POD.
You can pass the binary image data:
$nt->update({ image = > [
undef,
$filename, # the name Twitter will use for the image
Content_Type => $mime_type, # e.g, 'image/jpeg'
Content => $raw_image_data,
]});