GithubHelp home page GithubHelp logo

jjeaton / flickr-stuff Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drdrang/flickr-stuff

0.0 1.0 0.0 83 KB

Scripts for accessing and uploading to Flickr.

Home Page: http://www.leancrew.com/all-this/2011/08/more-flickr-api-stuff/

flickr-stuff's Introduction

Flickr stuff

A set of scripts and libraries for working with Flickr on a Macintosh. They all require Sybren Stüvel’s FlickrAPI library.

getFlickrToken

getFlickrToken authorizes any program you've registered with Flickr (http://www.flickr.com/services/apps/create/) and puts its "token" in your ~/.flickr directory. It's a command line program that your run with three arguments:

1. The program's api key, which you get from Flickr.
2. The program's api secret, which you get from Flickr.
3. The program's permissions (read, write, or delete), which you determine.

snapflickr

snapflickr takes a snapshot of your screen (similar to the builtin ⇧⌘4), saves a copy to your ~/Pictures/Screenshots folder (which you must create first), and uploads a copy to your Flickr account.

When snapflickr is run, it turns the cursor into a camera, ready to take a snapshot of any window (you can change it to take a snapshot of an arbitrary rectangle by pressing the spacebar). After the snapshot is taken, a window appears in which you provide a file name and (optionally) a description.

snapflickr dialog box

By default, the snapshot is uploaded to your Flickr account, but if you click the "Local file only" checkbox, there's no upload. If the image is uploaded to Flickr, its page is opened in the default browser and an <img> tag for the chosen size is put on the clipboard.

It requires Carsten Blüm's Pashua application and its accompanying Python library. The use is described in more detail here. It also requires the Python Imaging Library to add a desktop background color to window screenshots.

Near the top of snapflickr is a section of Flickr parameters:

# Flickr parameters
fuser = 'your Flickr username'
key = 'get your key from Flickr'
secret = 'get your secret from Flickr'
screenshotsID = 'the ID of the Flickr set'

These must be customized with the appropriate username, API info, and Flickr set ID.

currentflickr.py

This is a Python library for getting the name or certain types of URL for the Flickr image currently showing in your browser (works only for Safari and Chrome—sorry, Firefox users). In addition to the FlickrAPI library, it also requires the appscript library, which allows Python to handle Apple Events (like AppleScript).

I use the currentFlickrURL function to make TextExpander shell snippets that return the URLs for various sizes of an image and also to return an image's short Flickr URL (http://flic.kr/p/xxxxx).

Near the top of currentflickr.py is a section of Flickr parameters:

# Flickr parameters
fuser = 'Flickr username'
key = 'Get key from Flickr'
secret = 'Get secret from Flickr'

These must be customized with the appropriate username and API info.

Flickr.textexpander

This is a plist of TextExpander shell snippets for getting various Flickr URLs of the image shown in the frontmost tab of the browser. The snippets use the currentflickr.py library, so it must be customized with the user's name and API credentials and installed where Python can find it.

download-flickr-image

A script that downloads the large version of the Flickr image currently showing in the browser window and saves it to the Desktop. The filename is the Flickr image title, with ".jpg" appended if necessary. This is intended to be called via FastScripts or a similar utility. It dings using the Glass sound if it succeeds and burps with the Basso sound if it fails.

To play the sounds, the script requires the free Play Sound utility from Microcosm Software.

up2flickr

A script that uploads a list of images to Flickr. The title on Flickr is the file name minus the extension. The images are private by default but can be made public through a command line option.

Near the top of up2flickr is a section of Flickr parameters:

# Flickr parameters
fuser = 'Flickr username'
key = 'Get key from Flickr'
secret = 'Get secret from Flickr'

These must be customized with the appropriate username and API info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.