-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import old article "Fetch images from Flickr and show them in ..."
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
source/_posts/fetch-images-from-flickr-to-show-in-octopress-slash-jekyll.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
title: Fetch images from Flickr | ||
sub: And show them in Octopress/Jekyll | ||
date: 2012-07-21 17:53 | ||
categories: | ||
- programming | ||
- ruby | ||
tags: | ||
- flickr | ||
- ruby | ||
- api | ||
- octopress | ||
- jekyll | ||
--- | ||
| ||
<!-- more --> | ||
|
||
A convenient way to manage images for a blog is to host them on Flickr. | ||
|
||
Using the Flickr API, it's possible to do lots of useful things: use Flickr to serve thumbnails, fetch the metadata associated with the image, organise your galleries by tags then show them on your blog, ... | ||
|
||
Here is a very simple example. | ||
|
||
## The flickraw gem | ||
|
||
Flickraw is a very convenient gem for accessing the flickr API, making it super-easy. | ||
|
||
Add it to your gemfile: | ||
|
||
<script src="https://gist.github.com/3156265.js?file=Gemfile"></script> | ||
|
||
<small>(And don't forget to run `bundle install`)</small> | ||
|
||
## The FlickrImage plugin | ||
|
||
**Note:** you have to define "FLICKR_KEY" and "FLICKR_SECRET" as environment variables for this script to work. <br /><small>(You can find your flickr key and secret in your Flickr interface, after having registered your app.)</small> | ||
|
||
Put this file in the 'plugins' directory: | ||
|
||
<script src="https://gist.github.com/3156265.js?file=flickr_image.rb"></script> | ||
|
||
## Usage in a post | ||
|
||
<script src="https://gist.github.com/3156265.js?file=2012-07-21-post-with-images-from-flickr.markdown_"></script> | ||
Done ! |