<html><body>
<p>1 new commit in yt:</p>
<p><a href="https://bitbucket.org/yt_analysis/yt/commits/aca5c1974288/">https://bitbucket.org/yt_analysis/yt/commits/aca5c1974288/</a> Changeset:   aca5c1974288 Branch:      yt User:        xarthisius Date:        2016-04-06 22:42:35+00:00 Summary:     Bump imgur api to v3. Closes #1208 Affected #:  1 file</p>
<p>diff -r 2b15ed4adb92292dc18d50f778b813f7e003cfc3 -r aca5c1974288c97c26833a95506c54554cb77f1e yt/utilities/command_line.py --- a/yt/utilities/command_line.py +++ b/yt/utilities/command_line.py @@ -1075,25 +1075,33 @@</p>
<pre>print("File must be a PNG file!")
return 1
         image_data = base64.b64encode(open(filename, 'rb').read())</pre>
<ul><li><p>api_key = ‘f62d550859558f28c4c214136bc797c7’</p></li>
<li><p>parameters = {'key':api_key, ‘image':image_data, type:'base64’,</p></li>
<li><p>‘caption’: "",</p></li></ul>
<p>+        api_key = ‘e1977d9195fe39e’ +        headers = {'Authorization': ‘Client-ID %s’ % api_key} +        parameters = {'image': image_data, type: ‘base64’, +                      ‘name’: filename,</p>
<pre>'title': "%s uploaded by yt" % filename}
         data = urllib.parse.urlencode(parameters).encode('utf-8')</pre>
<ul><li><p>req = urllib.request.Request('<a href="http://api.imgur.com/2/upload.json">http://api.imgur.com/2/upload.json</a>', data)</p></li></ul>
<p>+        req = urllib.request.Request('<a href="https://api.imgur.com/3/upload">https://api.imgur.com/3/upload</a>', data=data, +                                     headers=headers)</p>
<pre>         try:
response = urllib.request.urlopen(req).read().decode()
         except urllib.error.HTTPError as e:
print("ERROR", e)
return {'uploaded':False}
         rv = json.loads(response)</pre>
<ul><li><p>if ‘upload’ in rv and ‘links’ in rv['upload']:</p></li></ul>
<p>+        if ‘data’ in rv and ‘link’ in rv['data']: +            delete_cmd = ( +                “curl -X DELETE -H 'Authorization: Client-ID {secret}'” +                " <a href="https://api.imgur.com/3/image/">https://api.imgur.com/3/image/</a>{delete_hash}" +            )</p>
<pre>print()
print("Image successfully uploaded!  You can find it at:")</pre>
<ul><li><p>print("    %s" % (rv['upload']['links']['original']))</p></li></ul>
<p>+            print("    %s" % (rv['data']['link']))</p>
<pre>print()</pre>
<ul><li><p>print("If you'd like to delete it, visit this page:")</p></li>
<li><p>print("    %s" % (rv['upload']['links']['delete_page']))</p></li></ul>
<p>+            print("If you'd like to delete it, use the following") +            print("    %s" % +                  delete_cmd.format(secret=api_key, +                                    delete_hash=rv['data']['deletehash']))</p>
<pre>print()
         else:
print()</pre>
<p>Repository URL: <a href="https://bitbucket.org/yt_analysis/yt/">https://bitbucket.org/yt_analysis/yt/</a></p>
<p>—</p>
<p>This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.</p>

<img src="http://link.bitbucket.org/wf/open?upn=ll4ctv0L-2ByeRZFC1LslHcg6aJmnQ70VruLbmeLQr27DI7VUK4k-2F-2Fj0AD0sdj9DjJKTE2tK8duYPwO3X4XqmO87IH5nasnjPRNNue9vYsYoaiSVr9RJM4uOYSm2Ki9x0ZPaMHXIuj30AHNsiERQudI8ZJYEc0toXgN6kzOJXpevZfpK4Vmb-2FOJC02ddIeqFyk6hwS2IHfpgL3yEb1cHWXCuW64D4Dn0v62NI1A8XZTI8-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>