Note that there are some explanatory texts on larger screens.

plurals
  1. POUpload images to Imgur from Mathematica
    primarykey
    data
    text
    <p>Here's a challenge to all <code>mathematica</code> tag followers. Let's make it a lot more convenient to insert images into SO post from Mathematica by creating an <a href="http://imgur.com/" rel="nofollow noreferrer">imgur</a> uploader.</p> <p>How can we create a function <code>imgur[g_]</code> that will rasterize its argument (making sure that the final size is not wider than the width of StackOverflow posts), convert it to PNG, upload it to imgur, and return a ready to be pasted <a href="http://daringfireball.net/projects/markdown/syntax#img" rel="nofollow noreferrer">MarkDown</a> line such as <code>![Mathematica graphic](http://i.imgur.com/ZENa4.jpg)</code> ?</p> <p>Useful references:</p> <ul> <li><a href="https://api.imgur.com/#anonapi" rel="nofollow noreferrer">Imgur API</a></li> <li><a href="http://blog.wolfram.com/2009/04/30/twittering-with-mathematica/" rel="nofollow noreferrer">Example of using POST request from Mathematica on WRI blog (posting to Twitter)</a> by <a href="https://stackoverflow.com/users/236064/ragfield">ragfield</a></li> <li><a href="https://stackoverflow.com/questions/5853134/upload-to-ifile-it-through-mathematica">Example of using POST requests from Mathematica on SO (uploading to ifile.it)</a></li> </ul> <p>I failed to adapt this latter method to uploading an image without exporting it to a file first.</p> <hr> <p><strong>Warning, use with care!</strong> StackOverflow uses a <a href="http://blog.stackoverflow.com/2010/08/new-image-upload-support/">separate imgur installation</a> that keep images indefinitely. If you use the main imgur, <a href="https://imgur.com/faq#long" rel="nofollow noreferrer">the images will disappear after 6 months if no one views them</a>. Unfortunately as of 2011 November there seems to be <a href="https://stackapps.com/questions/2664/is-there-an-api-to-upload-images-to-ses-imgur-installation">no official way</a> to upload images to StackOverflow programmatically.</p> <hr> <p><strong>Update:</strong> <a href="https://stackoverflow.com/a/8343460/695132">See below</a> a solution for uploading to StackOverflow <em>directly</em>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload