Note that there are some explanatory texts on larger screens.

plurals
  1. POPost picture from directory to tumblr via python
    primarykey
    data
    text
    <p>I searched the boards and found a thread to which I used to make a script to upload a picture to tumblr.</p> <pre><code>from tumblr import Api import sys def antearaTumblr(blog, email, password): BLOG=blog USER=email PASSWORD=password api = Api(BLOG,USER,PASSWORD) #data = open('C:/Users/Kevin/Desktop/python-tumblr-0.1/1329360987775.jpg').read() api.write_photo('http://www.jonathanworthington.co.uk/wp-content/uploads/2008/07/etc.jpg') title = '' body = '' api.write_regular(title,body) </code></pre> <p>This does work, it uses write_photo to grab a photo from the internet and upload it to my tumblr. However, I don't know how to make it grab a photo from a directory on my PC, like this....</p> <pre><code>from tumblr import Api import sys def antearaTumblr(blog, email, password): BLOG=blog USER=email PASSWORD=password api = Api(BLOG,USER,PASSWORD) data = open('C:/Users/Kevin/Desktop/python-tumblr-0.1/1329360987775.jpg').read() title = '' body = '' api.write_regular(title,data) </code></pre> <p>It succeeds in uploading, however all it uploads is this... ÿØÿà... which I assume is the jpg header.</p> <p>I found this topic <a href="https://stackoverflow.com/questions/4938203/post-picture-to-tumblr-using-python">Post picture to Tumblr using Python</a> but I don't know exactly what the replies are saying.</p> <p>Does anyone know how to get it to work using a directory and not a link?</p> <p>Also, i tried this <a href="https://gist.github.com/1242662" rel="nofollow noreferrer">https://gist.github.com/1242662</a> but honestly I just had no idea how to do it. </p> <p>Thanks for any help I receive. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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