Skip to main content

Picasa Photos in Blogger

I've been working on ways to get photos from Picasa into my Blogger hosted website. The normal slideshow doesn't work for me as it takes the user away to the Picasaweb pages.

Also when you take photos in the volumes I do, adding them one by one also doesn't work.

I had a look at the Picasa API options from Google, and was able with this simple PHP script to at least generate HTML code for each photo in a Picasa album. Host this somewhere or local using WAMP server.

Find the user ID and album ID, feed it in and run the script. When the output looks like you want it, view source and copy from <table> to </table> into your Blogger post.

The 'style="float: right; margin-bottom: 1em; margin-left: 1em;"' is the part that makes the click of a thumbnail load as a pop-up and not in a new window.

I want to work out a way to add Facebook Like and Google+ on a per photo level so I will probably update this script.

<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">
    <title>PicasaWeb Albums</title>
    // Check if action is set
            case "user_submit" :
                // Submission from the number submit form
                header("Location: ".$_SERVER["PHP_SELF"]."?user=".$_POST["user"]."&album=".$_POST["album"]);
            default :
                die("Unknown action : ".$_POST["action"]);


                    global $_GET;

    <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
        <input type="hidden" name="action" value="user_submit" />
        Please enter a PicasaWEB user ID : <input type="text" name="user" value="<?php echo $user; ?>"/><br>
        Please enter a PicasaWEB album ID : <input type="text" name="album" value="<?php echo $album; ?>"/><br>
        <input type="submit" value="Submit" />


    // set feed URL
    $feedURL = ''. $user .'/albumid/'. $album;

    // read feed into SimpleXML object
    $sxml = simplexml_load_file($feedURL);
    echo "<table border=0><tr>";
    $cellnr = 0;
    // iterate over entries in feed
    foreach ($sxml->entry as $entry) {

        // get nodes in media: namespace for media information
        $media = $entry->children('');
        // get thumbnail
        $attrs = $media->group->thumbnail[1]->attributes();
        $thumbnail = $attrs['url'];
        // get image
        $attrs = $media->group->content->attributes();
        $image = $attrs['url'];
        if ($cellnr == 4) { 
            echo '</tr><tr>'; 
            $cellnr = 1;
        } else {
            $cellnr = $cellnr + 1;
        echo '<td valign="middle">';
        echo '<center><a href="' . $image . '" style="float: right; margin-bottom: 1em; margin-left: 1em;">';
        echo '<img src="' . $thumbnail . '" /></a><br>';
        echo '</center>';
        echo '</td>';

        echo "</tr></table>


The source code part of this post was generated at


Popular posts from this blog

Double Bunk in Caravan

With our family expanding, we faced a challenge of adding another berth in our caravan, but I did not want to make it permanent. A couple of options are available, of which one is simply to add a bunk to the single berth. We however did not want to cause any permanent markings on the interior of the caravan .

Netdata + SNMP + Mikrotik

Always wanted to see my Internet line usage as a gauge without having to log into the router. So today I configured SNMP in Netdata to collect from my Mikrotik router. /etc/netdata/node.d/snmp.conf: { "enable_autodetect": false, "update_every": 5, "max_request_size": 100, "servers": [ { "hostname": "", "community": "public", "update_every": 5, "max_request_size": 50, "options": { "timeout": 20 }, "charts": { "mikrotik1.cpu": { "title": "CPU ", "units": "percentage", "type": "line", "family": "cpu", "dimensions": { "used&

CasparCG Simple Playlist

It is possible to build a simple playlist as a rundown in the CasparCG client. It will very simply play each item after each other that are on the same layer. In this very simple post I show how to build such a playlist including the very important step of activating the OSC. The Open Sound Control (OSC) implementation is how the client knows what the server is doing and then being able to send new command back to the server when a piece of media has ended to trigger playback of the next piece. For more details on the OCS, please see