As you have seen in previous chapters, Flickr provides excellent functionality to display and add narration to your photos; you can create slide shows; create sets; tack titles, descriptions, and tags to photos; and create groups to collaborate with others with similar interests. Yet, it is natural to want to present your photos outside the world of Flickr. If you have a personal blog, would you not want to display your photos on your own blog and tell stories around them?
As a Flickr user, you can automatically post a photo to your blog, provided you do the following:
First configure Flickr to work with your blog.
Hit the Blog This button for the desired photo.
The following sections are detailed instructions on the previous two steps. Before I cover how to use the automated process, I’ll cover how you would manually present a photo from Flickr on your blog. You would do the following:
Generate the appropriate HTML for the photo in question. For this to work, you would need to know the URL for the actual image, as well as the URL for the photo page. You could grab the URL of the image from the web browser (through right-clicking the image and copying the image URL, for instance).
If the photo in question is your own, Flickr provides some help in this department. For a given picture, hit the All Sizes button. For a given size of the photo, you can copy and paste the HTML given under the “Copy and Paste this HTML into Your Webpage” heading.
With the HTML now in hand, you would go to your blog to create a new post and then paste in that HTML.
Flickr helps automate this process by using blogging APIs. I’ll now cover how.
Before you publish your photos from Flickr to a blog, you need to tell Flickr about the blogs you plan to use. Here are step-by-step instructions for configuring your blogs for access by Flickr:
Go to http://flickr.com/blogs.gne
. You have to sign in to Flickr
first.
Hit the Add Another Blog link (http://flickr.com/blogs_add.gne
). You will see a list of
weblogs that you have already configured. Note the types of blogs supported by
Flickr:
Depending on the type of blog you want to integrate with, the parameters you will need to fill in differ.
Let’s take a look at two types of blog software to understand some of the necessary parameters involved in blogging integration: WordPress and Blogger.
To add a WordPress blog to your Flickr configuration, do the following:
Go to http://flickr.com/blogs_add.gne
. Make sure you have a
WordPress blog that you own for this example. You can either install your own
WordPress blog on your hosting service or use the free WordPress service (see
the “Free Hosted Blogs As a Way to Start Blogging” sidebar).
Click WordPress Blog in response to the question “What kind of blog
do you have?” Note that with this choice you end up at the URL
http://flickr.com/blogs_add_?
metaweblogapi.gne
—which suggests that WordPress is
accessible through the MetaWeblog API.[87]
Enter the following parameters:
API endpoint (for WordPress blogs, the URL is
http://{url-of-your-blog}/?xmlrpc.php
, for example,
http://blog.mashupguide.net/xmlrpc.php
)
Username
Password
After you hit Next—and assuming you entered the correct combination of API endpoint, username, and password—you have the choice of storing the password on Flickr and changing the URL or label. After you have entered your choices, click All Done.
You can now choose a template for your blog and customize it (if you know HTML and CSS).
You can test the blog configuration by issuing a test post. To do so, go to
http://flickr.com/blogs.gne
, and click the Test Post
button that corresponds to the blog. If things go well, you’ll get the
message “A test post to [name of your blog] has been sent. Feel free to
delete it once it’s gone through,” and you should see a test post
on your blog.
Blogger is another popular host of free blogs and is owned by Google. To add a new-style Blogger blog to Flickr, do the following:
Select Blogger Blog from the drop-down menu at http://flickr.com/blogs_add.gne
. Make sure you have a
Blogger blog, which you can sign up for at http://www2.blogger.com/create-blog.g
.
At this point, you may be asked to head over to Google to authorize Flickr’s access to your blog. If so, you will see a prompt like that in Figure 5-1. If not, skip to step 4.
Figure 5.1. Figure 5-1. A prompt from Flickr explaining the authentication process required to enable you to send Flickr photos to new Blogger blogs. (Reproduced with permission of Yahoo! Inc. ® 2007 by Yahoo! Inc. YAHOO! and the YAHOO! logo are trademarks of Yahoo! Inc.)
At Google, if you are not already logged in to Blogger, you will be prompted to log in. (Notice that it is Google/Blogger asking for the login, not Flickr here.) Once you are logged in, you’ll be asked to grant access rights to Flickr, as shown in Figure 5-2. Note the comment “Flickr.com will not have access to your password or any personal information.” There is a fuller explanation of how the authentication scheme works available on the Google web site.[88]
Figure 5.2. Figure 5-2. A prompt from Google requesting authorization to post to your Blogger blog from Flickr
If you grant access to Google, your browser will be redirected to a page presenting you with a drop-down list of the blogs available at Blogger. Select the one you want.
Verify the settings (you can change the URL and label). Hit the All Done button.
Test your settings by making a test entry to your blog. Do you see a test entry on your blog? If so, your parameters are correct.
Notice that you never enter your username/password for your Blogger blogs to Flickr at any time during the process.
Once you have a blog configured for blogging from Flickr, you are now ready to write a blog post based on a photo directly from Flickr. Here’s how:
Go to a specific Flickr picture, and hit the Blog This button located above the picture.
Choose the blog from the list to which you want to send the picture.
Fill out the title and your post; I often find it helpful to copy and paste the description of the picture into the post. Hit Return.
If everything goes according to plan, you’ll see the message from Flickr saying “Your blog entry has been posted!” and a URL to your blog so that you can check out your new post.
![]() | Note |
---|---|
Sometimes, you will get errors (such as timeouts). Often you can just try again. Sometimes Flickr reports an error when the post actually goes through and you can end up with multiple posts should you try again. |
After you have configured a WordPress or Blogger blog and posted a picture, I encourage you to think about what must be happening underneath the hood to make the Flickr blogging interaction happen. Here are some specific issues to consider and questions to ask:
Note the contrast in the parameters needed for a WordPress blog and a Blogger blog. For the WordPress blog, you need to enter an API endpoint along with the user and password, whereas for Blogger, you don’t enter those credentials but are redirected to Google for authorization. Here are some issues to consider:
What do you think is happening differently to account for the contrast in functionality?
Why do you not need to type in an API endpoint for Blogger?
Where do you send username/passwords for each case?
What are the advantages and disadvantages of each approach?
Note the wide variety of classes of blogs recognized by Flickr. You can try each type to study the parameters required to make each type of blog work.
Note that once you blog a picture in the Flickr interface, a list dynamically pops up via Ajax.
Study the types of templates available and how you can customize them via CSS and HTML.
After I describe web APIs in detail (for Flickr and for other web sites), I’ll answer the questions I just posed in Chapter 7. There I explore in greater detail the use of blogging APIs. Still, without diving into technical details about the APIs, you can make several observations:
Once you have configured a blog for access by Flickr, the process for publishing a photo is the same regardless of the actual blog you use.
By contrast, Flickr is unable to smooth out the differences among weblogs to make the configuration process look identical. That means the protocols for connecting to WordPress and to Blogger probably differ.
Blogging protocol must address the important issue of authentication and authorization; the process in which you grant Flickr the power to post to your blog depends on the type of blog you use.