1. goatkvlt asked: hey there. i'm new to php and was just wondering if you could tell me how you did to parse the images on your tumblr backup tool thing. sorry to bother but I'm really interested in doing this stuff. not looking for a tutorial or anything, just somewhere and I'll really appreciate it.

    cheers.

    I parsed a file_get_contents(api/read URL) return value directly, using domxml_open_mem(). The script walks the many-to-one photo-url children of each photo post. Each photo-url contains the URL for a copy of the original image sized up to, but not larger than, the attributed max-width. For high-resolution images, each URL will be distinct. For small original images, you will see the URL to its largest size repeated, for example: 


    <photo-url max-width=”1280”>
    http://25.media.tumblr.com/SJZFJaHDo5vco3muV3EgxVjo_250.jpg
    </photo-url>

    <photo-url max-width=”500”>
    http://25.media.tumblr.com/SJZFJaHDo5vco3muV3EgxVjo_250.jpg
    </photo-url>

    <photo-url max-width=”400”>
    http://25.media.tumblr.com/SJZFJaHDo5vco3muV3EgxVjo_250.jpg
    </photo-url>

    Knowing an element for each of the standard max-widths will be present even for smaller images allows you to simplify by checking directly for a given max-width. You can also iterate through doing a getimagesize() on each to find actual dimensions.

    1 year ago  /  3 notes

    1. paultron said: I am actually starting out on learning PHP today!
    2. boutofcontext posted this