Given an image with a specific address, http://www.thissite.will/never/be-finished.png , what is the easiest way to share it on Twitter, preferably without a map?
The user configures the SVG, and when they are satisfied, I convert it to PNG and save it on my server.
I want to give them the opportunity to share their image on Twitter. They click on the button (which I can implement) and a dialog box opens where they can add to the tweet (which should already contain the image).
I know that similar questions have been asked on this site before, but I do not want to use a โmapโ to share the image. Instead, I want a typical, non-card Tweet, only with an image (like this ).
I have repeatedly looked at the Twitter Developer documentation, but I cannot find useful information. The POST method status / update_with_media is out of date, and the link to the Media Download Guide, the proposed replacement, is broken. This guide , I suppose, is what it is intended for reference to, but it does not have JavaScript code to suggest how this should be implemented.
Please, help.
My attempt based on POST media/upload :
$.ajax({ url: "https://upload.twitter.com/1.1/media/upload.json", format: "post", data: {"data" : link} }).success(function(response) { console.log(":)"); console.log(response); }).fail(function(response) { console.log(":("); console.log(response.responseText); });
It fails. responseText - {"errors":[{"code":215,"message":"Bad Authentication data."}]} .
Basically, I want to do something similar to what StackOverflow does. When you click โshareโ a question, then select โTwitterโ, a new window will appear, filled with a link to the question and where users can write their own message. (Twitter provides an interface.)
In my case, however, when a tweet is sent, and then a link to the page appears and some text extracted from it, I would like to have only an image.