5

Guys I've been searching examples and tutorials how to tweet an image canvas, but I have no luck in finding one. I already know how to in facebook (I found a good example). Can someone help me?

noobprog
  • 327
  • 1
  • 4
  • 16
  • Which of the many possible solutions for posting canvas images to Facebook did you use, and what problem exactly did you encounter when you tried to adapt the same solution for Twitter? – Philipp Apr 07 '14 at 07:57
  • https://github.com/lukasz-madon/heroesgenerator i used this example and it worked for me, for twitter, I don't know how to begin with because twitter wants the image the be accessible via url – noobprog Apr 07 '14 at 09:32
  • The Twitter API call [statuses/update_with_media](https://dev.twitter.com/docs/api/1/post/statuses/update_with_media) does not require an URL. It accepts the image-file as encoded BLOB. – Philipp Apr 07 '14 at 10:02
  • possible duplicate of [Convert HTML5 Canvas into File to be uploaded?](http://stackoverflow.com/questions/19032406/convert-html5-canvas-into-file-to-be-uploaded) – Philipp Apr 07 '14 at 10:11
  • Yes you're correct, im reading the api doc now, but still as far as i understand, statuses/update_with_media is done server side, the example I used above in facebook directly uploads the canvas client side. – noobprog Apr 07 '14 at 10:20
  • It's a webservice. You should be able to access it with a AJAX call from the client-side when you authenticate the user via [3-legged OAuth](https://dev.twitter.com/docs/auth/3-legged-authorization). – Philipp Apr 07 '14 at 10:31
  • thanks phillip, ill have a try of this one. – noobprog Apr 07 '14 at 14:08
  • to start with you'll need to encode it to base64, save it to a server and then use the twitter API to tweet it, this answer will get you some of the way there http://stackoverflow.com/questions/5292689/sending-images-from-canvas-elements-using-ajax-and-php-files/5303242#5303242 – Pixelomo Dec 04 '15 at 09:31

0 Answers0