Category Archives: Design

Integrating Picasa Web Photos with WordPress

OMG is this so much harder than it needs to be.

Picasa (or Google) offers nothing in the way of little blog widgets (unlike Flickr’s great support for everything), nor is there really any third-party support for this kind of thing out on the web.

I don’t understand why, since — at least to me — what Picasa offers for free is so much better than what Flickr offers, still, even to this day. :

Every third-party WordPress plugin I’ve tried either doesn’t work, doesn’t work right, or needs so much configuration on the server side — and I’m talking about editing raw PHP here (unacceptable) or creating farking CURL scripts for the server (why did you even release this plugin?).

Sadly enough, the BEST solution I could find for the problem of integrating Picasa was actually done in straight JavaScript (yay!), found here: http://www.bloggingtips.com/2009/03/23/picasa-widgets-and-plugins-for-your-blog/

Her code works great, works fast, requires almost no configuration (besides your Picasa username), and uses JQuery, so pretty much anyone can edit and customize it.

Which I did. ^_^ Though the code works, it doesn’t appear to always grab your latest photos from Picasa. (I’m guessing it has something to do with the “max-results” flag in the URL string — you have to restrict the number of photos that Picasa feeds up for you to get the latest.) I also made each photo be a link to the Picasa page where it’s at, as well as cleaning up the code a little.

There’s basically two parts:

First, put this code in a widget text block where you want it to be in your wordpress blog (this is also where you can edit the style):

<style>
#picasaStream img {border: 1px solid #000; margin: 0 5px 5px 0;}
</style> 

<div id="picasaStream"></div>

Second, put this code either right after the widget, or wherever you put your JavaScript (if you choose to put it in another place, like a footer):

<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>

<script type="text/javascript">
/*
****	Uncomment this line if you are using other JavaScript libraries
****	(Prototype, Scriptaculous, etc.)
*/
// jQuery.noConflict();

jQuery(document).ready(function(){
	/*
	****	Change your Picasaweb username here,
	****	as well as how many thumbnails you want to show
	*/
	var _userName = "captainskyhawk",
		_count = 6
		
	/*
	****	Choose your thumbnail size here:
	**** 	"0" for small, "1" for medium, and "2" for large
	*/
	var _thumbnailSize = 0;
	
	/*
	****	Script Code
	****	No need to edit any further
	*/
	jQuery.getJSON("http://picasaweb.google.com/data/feed/api/user/" 
		+ _userName + "?kind=photo&thumbsize=72c&access=public&alt=json&max-results="
		+ _count + "&callback=?",
		function(data){
			jQuery.each(data.feed.entry, function(index, pic) {
				jQuery('<a href="' + pic.link[1].href + '"><img src="'
					+ pic.media$group.media$thumbnail[_thumbnailSize].url
					+ '" alt="' + pic.summary.$t + '" /></a>')
				.appendTo("#picasaStream");
			});
		}
	);
});
</script>

Just change your name in the code from “captainskyhawk” (that’s me!), and it should work!

Pattie Maes demos the Sixth Sense

Pattie Maes demos the Sixth Sense | Video on TED.com

I love hearing and reading about what goes on at the yearly TED (Technology, Entertainment, and Design) conference — it’s like a big symposium where people demo new technologies and products. You’ll see stuff demonstrated here 5 years or more before it possibly comes to the market (which it nearly always does). This is where I saw a technology strangely similiar to “Microsoft Surface” demonstrated years before Microsoft announced it (I still think they either stole it or bought the technology).

The video I linked here, while just a prototype, is what I keep telling people to look for in the next “big thing” — ubiquitous, nearly omnipotent meta-information, though more than likely in its end form, only the user will be able to see what he/she is manipulating (think video glasses).

My Tumblr

Make sure and check out my new little widget thingy over in the right-hand sidebar — it’s a plugin that shows the last 6 or so entries on my tumblr page.

I love my little tumblr account — it’s like Twitter, but I use it as a picture blog. The pictures you see on their are all uploaded from my cell phone, when I’m out and about.

The tumblr plugin code is a wonderful little bit of code from Robert Nyman — I had been working on my own Tumblr include script a while back, but was going at a from a completely different direction (I was trying to parse things server-side beforehand, and was kinda rusty when it comes to PHP). Robert apparently thought about doing the obvious thing and loading the Tumblr JSON API into an html “script” tag, and then just using JavaScript to do everything. Bloody brilliant.

New WordPress Blog

Yep — Nina helped me set up a wordpress blog for me over at http://www.threshold-zero.com/wordpress//.

Whatta you know, eh? Me with a wordpress blog. Well, it’s mostly to help out Nina and create WordPress-centric plugins — the idea has actually interested me quite a bit.

I’ve been working on a “plugin” type script for Tumblr (you can see it spinning over on the right when you first load up this page) — if you’ve got a Tumblr blog, you’ll notice that there isn’t any available, at least from them. (Aye, I know Twitter has quite a few neat blog plug-ins available, but the Twitter site itself can’t accept Photo-SMS, like Tumblr can). The idea behind Tumblr is very neat, and very easy to use, especially if you’re the kind of person who doesn’t like a lot of fluff, and just wants an simple, straightforward interface (I’m looking at you, Bubu).

I’ve already got a “plugin” like this for my blog here, using Textpattern (it uses the great jQuery library), and I’m interested in porting it to WordPress.

I’ve got some questions first, though, about the wordpress engine:

1) Does wordpress have a default feed-proxy (to get around server-side restrictions on XMLHttp commands)?

2) Does wordpress have a built-in image manipulation proxy (some file like “image.php” that you would load with parameters to load up manipulated images)?

Once I get these questions answered, I’m already halfway there! (There’s a great page all about this at http://codex.wordpress.org/Plugin_Resources — I plan on reading that when I get a chance, of course.)


*Automotive Report!*

_Beetle Bug_

We finally got Nina’s Beetle’s car problems fixed, and every bit of it was covered under warranty! The VW guys know their stuff, I’ve got to admit — they were right about the vibration being a faulty wheel bearing, and they even tracked down the elusive glow plug fault that I had tried tracking down myself.

They reached the same conclusion that I did, ultimately — the fault lied in the wiring harness that fed into the glow plugs, and not the glow plugs themselves. Unlike me, however, they had extra wiring harness lying around, and were able to repair it — it would’ve cost me almost $100 bucks, even if I had bought the parts myself!

We forgot to tell them about the “left your lights on”-chime being broken, but at this point I’m so glad the other stuff is fixed, I’m keeping my mouth shut. We’ll get it fixed when we can.

_General Lee_

The General Lee is now sitting on ramps in my front yard, out of commission — mostly because its exhaust is in shambles. Sigh, if it’s not one thing, it’s another — I spend weeks repairing its electrical problems and other engine gremlins, only to have a rusted exhaust put it out of commission.

Hey, at least parts for it are cheap as hell. This time, I’m not just going to patch up the exhaust for it — I’m going all out on good stuff from Summit Racing.com, including an actual real tailpipe! The tailpipe’s for a 5.0 mustang, but it’ll fit on my four-cylinder just fine, and I’ll only need to buy one! Harr harr!

_Mauve Storm_

The Mauve Storm drives just fine, but the detonation problems continue — I’m still tracking down the problem, but I haven’t had much time to check. It doesn’t help that the engine itself is so _big_ (not big as in powerful, but just big as in “bulky” — there’s no room to manipulate anything in the engine, leading to half a dozen different parts needing to be removed every time I need to do a minor change).

At least I’ve eliminated the possibility of the timing being off — I finally figured out the proper way to use my timing gun, and it checked out okay. I’m leading towards my spark plugs being messed up — it’s been more than two years since they’ve been changed, and that’s about long enough for a engine that’s driven more than 15,000 miles a year.

I’ve tried to buy some proper Motorcraft spark plugs from the local Ford place (helping out the American automotive industry and all that), and that would’ve been fine… had they sold me the right fucking part to begin with. I go in there, tell them exactly what I need and exactly what car I have, and they sell me the parts for the 300hp Cobra engine instead of just the 200hp GT engine like I’ve got. The spark plugs’ll probably fit, but they’re not _made_ for my engine — their heat range is different from what my engine’ll be expecting, and that could potentially fuck up things even more.

In case you’re wondering — yeah, I could return them… if their policy didn’t state “no returns on electrical parts.” Thanks a lot, guys.

Sigh, that poor thing — there’s so much stuff I want to just fix in its engine, but I’ve nary the time nor the money (contrary to the General Lee, parts for the Mauve Storm cost quite a bit more). Though, I see a change a-happening in that — I’m a bit more organized with my time off on weekends and days off now, and I’m starting to get more done! So, here’s to hoping.

Moblog!

I finally got me a moblog — a _real_ one, this time. Take a look over on the right — it’ll show the most recent photos from my camera phone.

It’s the culmination of several weeks of coding, drawing from both my newfound experience in JavaScript, as well as good-old-fashioned time-honored server-side PHP! (That PHP coding was a doozy, too, seeing as how I haven’t coded anything in it in years… but I came through, in the end.)

Keep an eye out!