Adding support for posting a status with media #169

wants to merge 6 commits into


None yet
4 participants

rinogo commented Mar 1, 2013

@RWAP added support for posting a status with attached media. However, his changes were based off of the 1.0 API. This pull request combines @RWAP's changes with @aaronwaldon's proposed 1.1 API pull request.

aaronwaldon and others added some commits Feb 19, 2013

@aaronwaldon aaronwaldon Updated for use with Twitter API version 1.1
The search endpoint is no longer a separate URI ( Everything else seems to work as expected, as long as the user authenticates. I have tested this with almost all GET endpoints, but not for any POST endpoints.
@aaronwaldon aaronwaldon Simplified API Version 1.1 Support c3e3357
@aaronwaldon aaronwaldon Updated EpiTwitter for API v1.0 compatibility.
This change allows version 1.1 to work, while still allowing the default (version 1.0) to work as expected.
@aaronwaldon aaronwaldon Forgot to add the getApiURL method change...
Will use the search version 1 API URI if applicable, but will use the normal API URI otherwise.
@rinogo rinogo Adding changes from RWAP's fork (up to and including commit 5c1775d) …
…to add support for media uploads.
@rinogo rinogo Updating getApiUrl() to point to the correct media url (api.twitter.c…
…om) for version 1.1 (while still pointing at for version 1.0).

In Twitter API 1.1 they recommend to use url for media upload

also after I switch the code to support 1.1 I get this error every time I try to upload media

{"errors":[{"message":"Status creation failed: The text of your tweet is too long.","code":190}]}

$twitterObj->post('/statuses/update_with_media.json', array('@media[]' =>"@{$media};type=".$extension_mime_type[$extension].";filename={".$pathinfo['basename']."}", 'status' => $tweet));


I found the issues, just need to change EpiOAuth.php


jmathai commented May 2, 2013

A simple merge of this caused some of the unit tests to fail. I assume it's got to do with the URL changes for 1.1.

I'll have a look later but if you want pull from upstream master and you should be able to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment