Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upHelp with posting an update with an image #58
Comments
This comment has been minimized.
This comment has been minimized.
|
Hey @tbwhite, Here's a sample from a post I just added to the TwitterDev forums.
{
"image": {
"w": 1024,
"h": 576,
"image_type": "image/jpeg"
},
"media_id": 588185299844370432,
"media_id_string": "588185299844370432",
"size": 105489
}Then to Tweet that
{
"created_at": "Wed Apr 15 03:51:40 +0000 2015",
"id": 588187910811299842,
"id_str": "588187910811299842",
"text": "Sample Tweet with media_ids and twurl http://t.co/fyPdMIfcNM",
...
"media": [
{
"id": 588185299844370432,
"id_str": "588185299844370432",
"indices": [
38,
60
],
"media_url": "http://pbs.twimg.com/media/CCmnafNUkAA0R-8.jpg",
"media_url_https": "https://pbs.twimg.com/media/CCmnafNUkAA0R-8.jpg",
"url": "http://t.co/fyPdMIfcNM",
"display_url": "pic.twitter.com/fyPdMIfcNM",
"expanded_url": "http://twitter.com/jaakkosf/status/588187910811299842/photo/1",
"type": "photo",
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"small": {
"w": 340,
"h": 191,
"resize": "fit"
},
"medium": {
"w": 600,
"h": 337,
"resize": "fit"
},
"large": {
"w": 1024,
"h": 576,
"resize": "fit"
}
}
}
]
},
"extended_entities": {
"media": [
{
"id": 588185299844370432,
"id_str": "588185299844370432",
"indices": [
38,
60
],
"media_url": "http://pbs.twimg.com/media/CCmnafNUkAA0R-8.jpg",
"media_url_https": "https://pbs.twimg.com/media/CCmnafNUkAA0R-8.jpg",
"url": "http://t.co/fyPdMIfcNM",
"display_url": "pic.twitter.com/fyPdMIfcNM",
"expanded_url": "http://twitter.com/jaakkosf/status/588187910811299842/photo/1",
"type": "photo",
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"small": {
"w": 340,
"h": 191,
"resize": "fit"
},
"medium": {
"w": 600,
"h": 337,
"resize": "fit"
},
"large": {
"w": 1024,
"h": 576,
"resize": "fit"
}
}
}
]
},
...
}Which resulted in this Tweet: https://twitter.com/jaakkosf/status/588187910811299842 |
This comment has been minimized.
This comment has been minimized.
tbwhite
commented
Apr 15, 2015
|
Thanks for helping, unfortunately when I do this: twurl -H upload.twitter.com "/1.1/media/upload.json" -f I get the following result: {"request":"/1.1/media/upload.json","error":"not recognized."} Any ideas ? Also, I am using version 0.9.2 On 4/14/2015 9:13 PM, Jacob Petrie wrote:
|
This comment has been minimized.
This comment has been minimized.
|
Try running the same command with a |
This comment has been minimized.
This comment has been minimized.
|
I've just tried doing this on Windows 8, with Ruby installed via RubyInstaller, and twurl 0.9.2 from RubyGems. Tried via cmd.exe and powershell in case of some weird environment issue. I'm not able to reproduce.
|
This comment has been minimized.
This comment has been minimized.
tbwhite
commented
Apr 15, 2015
|
This is what I get when I run with the -t flag: C:\Users\Tom>twurl -H upload.twitter.com "/1.1/media/upload.json" -f On 4/15/2015 2:54 AM, Andy Piper wrote:
|
This comment has been minimized.
This comment has been minimized.
robdevelop
commented
Apr 20, 2015
|
Did you achieve any resolution with this? I am having what looks to be the exact same issue. Although a novice, you would think the twurl example provided by Twitter would actually work, but in this case I have no clue as to what is wrong. |
This comment has been minimized.
This comment has been minimized.
sebagomez
commented
Jun 4, 2015
|
I'm using So frustrating when an example doesn't work :( p.s: I get the same with both jpg and png files |
This comment has been minimized.
This comment has been minimized.
darthgooch
commented
Oct 24, 2015
|
I am also having this issue, and have tried ~5 different computers. I am using the following: C:\Ruby22\bin>twurl -H upload.twitter.com /1.1/media/upload.json -f C:\Advert.jpg -F media -t -X POST C:\Ruby22\bin>twurl -v C:\Ruby22\bin>ruby -v |
This comment has been minimized.
This comment has been minimized.
sebagomez
commented
Oct 27, 2015
|
Just so you know it worked for me. I was using the code from github when I got those errors. After that I decided to install Ruby from chocolatey. I finally got v2.1.6 and from there twurl v0.9.3 and it worked!. |
This comment has been minimized.
This comment has been minimized.
joonjoonjoon
commented
Jul 16, 2016
|
I get this error, and even on ruby 2.1.6 and Twurl 0.9.3 or 0.9.2, I cannot get past the 'media type unrecognized" issue. I can post status updates, but not images. Anyone figure out why this could be happening? I tried many images, types, stripping EXIF, encodings, etc... and nothing works. |
This comment has been minimized.
This comment has been minimized.
nvanesch
commented
Sep 19, 2016
|
my problem on windows is ruby did not binary read the full file so only sent the first 100 bytes or so. I had to change to binary file read (instead of just File.read I needed to use File.open with "rb" binary option. on windows
|
This comment has been minimized.
This comment has been minimized.
|
Closing for age / inability to repro - please open a new issue if this still occurs with 0.9.3 |
tbwhite commentedApr 14, 2015
Can someone give me an example of how to post an update with an image using twurl ? This would be using media/upload and statuses/update.