< Browse > Home

| RSS

Zend Framework and Zend Gdata API provide a simple and effective solution to display pictures and galleries from your picasa account in your own custom website. Lets take one of the public galleries in picasa show it in a custom php page in this website.

Zend Framework
Before we start. In order to use Zend Gdata API, you need to have Zend framework (1.6 or higher) installed, If you have the full framework package installed , you won’t need to worry about anything, you can go ahead and start calling the APIs directly, In case if you don’t have the full framework package installed, you will have to download and configure Google Data Client Library. Details of setup and configuration are listed in the following link

http://code.google.com/apis/gdata/articles/php_client_lib.html#gdata-installation

CODE :)
The following url refers to a public picasa gallery

http://picasaweb.google.com/shasankar/SampleGallery#

The URL has two important pointers, the picasa user id the one that follows the picasaweb.google.com domain, its usually the picasa user name, in some cases it can also be a long alphanumeric string, this is the user id, the other one is the gallery name, in this case it is ‘SampleGallery’

The following script allows you to load pictured directly into your website


<?php
error_reporting(E_ALL);
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata_Photos');

// Album and User
$sUserID = "shasankar";
$sAlbumName = "SampleGallery";

$serviceName = Zend_Gdata_Photos::AUTH_SERVICE_NAME;
$gp = new Zend_Gdata_Photos();
$query = $gp->newAlbumQuery();
$query->setUser($sUserID);
$query->setAlbumName($sAlbumName);
$query->setImgMax("800");
$query->setThumbSize("160");
$albumFeed = $gp->getAlbumFeed($query);
$sPrintThumbs = "";

foreach ($albumFeed as $albumEntry) {
if ($albumEntry->getMediaGroup()->getThumbnail() != null) {
// Load Thumbnail Info
$mediaThumbnailArray = $albumEntry->getMediaGroup()->getThumbnail();
$ThumbnailUrl = $mediaThumbnailArray[0]->getUrl();
$ThumbnailHeight = $mediaThumbnailArray[0]->getHeight();
$ThumbnailWidth = $mediaThumbnailArray[0]->getWidth();
// Load Picture Info
$mediaArray = $albumEntry->getMediaGroup()->getContent();
$ImageUrl = $mediaArray[0]->getUrl();
$sImageTitle = $albumEntry->getMediaGroup()->getDescription()->text;
$url = $albumEntry->getLink('alternate')->href;

$sLinkString = <<<LTEXT
<a href="$ImageUrl" title="$sImageTitle"><img src="$ThumbnailUrl" width="$ThumbnailWidth" height="$ThumbnailHeight" /></a>
LTEXT;
$sPrintThumbs .=$sLinkString ;
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title> Loading pictures from Picasa Gallery</title>
</head>
<body >
<div>
<div>
<h3>SampleGallery (Picasa)</h3>

</div>
<div>
<?php echo $sPrintThumbs; ?>
</div>
</div>
<div class="clear"></div>
</body>
</html>

The Api allows lot of customization options, thumbnail size, final image size, number of results per page, etc, these setting have to passed along with the Album query that is sent to picasa.

Picasa album in Custom Webpage

Related Links

If you want to display private picasa galleries in your website, you can make use of zend authentication api, you can read more about it here

http://www.ibm.com/developerworks/library/x-picasalbum/#c5

[ View Post ]

CSS Hacks for IE8

[ More ] Dec 17, 2009 | No Comments | Posted in HowTo, Web Development |

Here it is, CSS Hacks for IE8, But, be little cautious while using them, sometimes, they may not work well with complex CSS syntaxes.

IE8 Standards-Mode Only:

.test { color /*\**/: blue\9 }

All IE versions, including IE8 Standards Mode:

.test { color: blue\9 }

[ View Post ]

Public waves allow wave users to publish and share their waves with other Google Wave users, and hence allowing everyone to contribute and make changes in the wave

Accessing public waves

To access public waves, you will need to enter the following keyword, in the search box

with:public

To search public waves, you can use a with:public following by the search string, for eg.

with:public Chennai

Will return all public waves with the keyword Chennai

Accessing public waves

Accessing public waves

Making a wave public

In order to make a wave public and to grant access to everyone, you will need to give access to the user called public@a.gwave.com. In the add contact screen , fill in public@a.gwave.com and Press “Enter”, even if the submit button is not activated, the public user will be added to your account. This looks like a bug in the wave system, expecting Google to fix it soon.

Once this user is added, any waves published along with this user will be available in public domain.

[ View Post ]

At last I got my Google wave account activated yesterday, but it didn’t carry any additional invites that can be passed on to others. Its a bit tricky if it doesn’t carry additional invites, since you wont be able to share and evaluate this technology with others. Please take a look at some of the Screenshots of Google Wave.

Google Wave Homepage

Google Wave Homepage

A Public Wave

A Public Wave

The Wave API will allow plug-in developers to develop extensible plug-ins. Sudoko plug-in was quite interesting. So was the Google Maps plug-in, the live connectivity was just too good.

Playing Sudoko in GW

Playing Sudoko in GW

GW Error Messages

GW Error Messages

Google Wave Extensions

Google Wave Extensions

On a overview, Google wave seems to show the light of how the next generation of communications will look like. This technology has the prospect to replace email altogether (am i hyping it too much ??). But on an overview i am not able to define Google wave properly, yes it is a collaboration platform, but its a mix of email, instant messaging, blogs and other things. I will not term Google wave as a social networking platform/tool, because this is more sort of a communications platform, more to do with interactions and collaboration, and real time information exchange (more reason being, it could attract an access ban by employers, if termed so.. he he :) ). I will take a look at API’s now, and will try to post if i am able to build something out of it.

[ View Post ]

Atlast I managed to find the link for Ubuntu version of Google chrome. Please check below. This one runs faster and takes up very very less memory when compared to firefox. Very cool download :)

The minimalistic approach of Google chrome gives itself an unique edge over other browsers in terms of speed comparison ratios. Google has always pioneered in offering technology to meet the exact needs of people and thus attracting users by simplicity. It is so very evident in all their engineering, take Google search, Gmail, Gtalk, and now chrome. Google has been successful by offering just the basics in a perfect manner. And thats the same reason why I was attracted to install Google Chrome in Linux.

Also check this link for an interesting comparison of Linux based browsers, looks like Firefox is way behind when compared to Opera or Chrome..

http://penguininside.blogspot.com/2009/08/web-browser-comparison-and-benchmarks.html

Download Link: http://www.google.com/chrome/intl/en/eula_dev.html?dl=unstable_i386_deb

[ View Post ]