Security cam blog posts on Tumblr

Conclusions and Future

Now, the Tumblr features come into play. Line 31 reads the YAML file with the tokens, and line 33 creates a new object of the WWW::Tumblr type. Drawing on the Tumblr API, line 43 then retrieves the details of the previously defined test blog (schtonk.tumblr.com) and the post() method sends the image file content to the Tumblr server, specifying the type as photo. Then, $post indicates success with a true value. If you then launch the script by typing ./tumblr-post, the response is the ID of the newly created blog entry:

I have published post id: 63791478637

Unfortunately, the API provides no way to attach an image caption. This method currently seems to work only via a browser interface that allows HTML pages with embedded photos. Theoretically, however, the script could upload text and reference the images on a different server. For the surveillance photos, however, it is more convenient for me to store the images on Tumblr.

A viable alternative would be a caption in the image itself, as presented in last month's Perl column using the CPAN Imager module. In this way you could add brief texts to the image – for example, the current outdoor temperature.

The Author

Mike Schilli works as a software engineer with Yahoo! in Sunnyvale, California. He can be contacted at mailto:mschilli@perlmeister.com. Mike's homepage can be found at http://perlmeister.com.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Perl: Spotify

    For a monthly fee, the Spotify streaming service beams music onto your desktop or phone. To intensify the groove, Perlmeister Mike Schilli archived his Spotify playlists for eternity using an OAuth-protected web API.

  • Programmatically change YouTube metadata

    Instead of manually editing the metadata of YouTube movies, video craftsman Mike Schilli dips into YouTube’s API spell book and lets a script automatically do the work.

  • Perl: Dropbox

    The proprietary Dropbox service has become a popular way to exchange large files. The Dropbox web API also supports scripts, like the one in this article that picks up files from behind a firewall.

  • Patterns in the Archive

    To help him check his Google Drive files with three different pattern matchers, Mike builds a command-line tool in Go to maintain a meta cache.

  • Programming Snapshot – Driving Data

    A connector plugged into the diagnostic port of Mike Schilli's cars sends current information such as speed, acceleration, and fuel economy via the mobile phone network to a cloud service. An app and a programmable API read out the data and provide stunning visualizations.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News