February 2005 Archives
I'm pleased to present the Flickr Favorites Browser.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Yes, it's the same thing I had hacked out in perl a while ago. But now I've finished (mostly) the port to PHP. By using the Smarty template system I get caching and a nice separation of logic and presentation. There isn't a single piece of HTMl in my PHP code.
2002 seems to be an okay year. Not bad for a sub-$5 bottle.
Please don't stop me from drinking
It's my only joy
Please don't stop me from smoking
This is my reward
For all the things I have spoken
and all the times I fell
For one taste of the good life
I would kill
Gene -- "Sick, Sober and Sorry"
Moving from perl to PHP isn't always easy, especially when you use CPAN modules to get most of the work done. But I had no idea I was digging such a hole with my decision to move to php. The Smarty setup isn't that big of a deal, but it does force you to think about how you want to separate logic from presentation and how to best get HTML out of your code and into your templates. Your code should deal with data, not ever-changing HTML.
Then there is the issue of parsing the xml that you get back from the Flickr REST interface. zeman on the Flickr API group pointed me to miniXML, which is nice since it is pure PHP and requires no additional modules. It did take a while to get used to though, even with the nice docs and samples. I'm just slow that way.
Speaking of slow, I haven't even fully replicated the main feature of the perl version, that is to have the first column be a specified user's favorites and the rest of the row be the favorites of the owner of the picture in the first column. Although, now that I have my head around miniXML and how the Smarty templates are going to be laid out, I should be able to make better progress. I would like to have something I'm not embarrassed to post the code for by tonight.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
A word of advice. When you write a script that uses the Flickr API and it stops working from your server, hosted off a DSL line at a friend's house in the SF Bay Area, do not start freaking out and posting the the Flickr API Group or the Flickr API mailing list about a possible IP block on API calls. Instead, go through the logs on the machine and find that overnight kswapd, in a "out of memory" panic, went "ape poopy" crazy and randomly killed processes (like named) so that the script could no longer resolve flickr.com. Just sayin'...
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
2003, quite cheap and quite tasty!
Over at the Unofficial Apple Weblog we read that Mike Ramsey switched to using a powerbook. Of course, one thing always leads to another and pretty soon everyone will want one. Or at least that is the conventional wisdom since there are supposedly rumblings in IT about moving to macs. I'd buy that for a dollar. Alas the CW in this cased is based on a bogus assumption.
This is good for Apple, because if the big man in a company wants something, he gets it, even if his corporate IT department usually won’t support Macs. How soon before other top execs who just want to get work done wise up and buy an Apple? (*emphasis* mine)
"Top Execs" belong to the cool kids club. They need to look cool but they can't really wear an iPod Shuffle into a meeting, hence the powerbook. Oh I'm sure his complaints about Windows were for real but this isn't about "getting work done." Trust me.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
A quick peek at the debug html comments shows that some of my problems are that people don't have that many favorites. It's like getting into Dave Gorman's Googlewhack Adventure, where every new turn leads into a dead end...only, it's not funny. Maybe I'll just give up on perl and port the thing over to PHP so I can at least feel like I'm doing something.
It is still far from being anywhere close to being ready for "prime time," but I am moving forward. There are no user interaction features as of yet, hence me posting static HTML and not a nice web interface for you to use. The originating username is still hard coded. I have somewhat solved the problem where a person does not have enough favorites to complete a row. I have a quick hack to prevent two rows in a row from having the same owner, although this is a cheap hack. I need to make sure there are no duplicate rows in the whole square. I can do this by either grabbing another batch of favorites for the same owner or skipping an owner after they have gotten a row. I would like to add some visual styling to show which photos are which as I always run into problems explaining the concept to people.
Every decision I make revolves around keeping the number of API calls to a bare minimum. I also want to keep the size of the calls as small as possible. I try to only ask for the number of favorites that I actually need to make a square instead of the default 50. XML is verbose and the less the API has to send back the better. Of course, that means more logic and data structure fu on my end and boy, is my perl rusty!
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Remember when kat started trimming that poor apple tree? Well, she's done.
So I made my first foray into the land of Flickr programming. I'm using the perl Flickr::API module and it was quite easy to use once I found the Linux Gazette Flickr and Perl article by Jimmy O'Regan to help me get past the perl XPath stuff. The hardest part was coming up with an idea of what to do with it. So this is what I came up with:
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
What is it? I'm glad you asked. It's a small sample of my Favorites Browser. The basics structure is that pictures in the first column are ones that I have marked as a favorite. The pictures that extend out in the row are the favorites from the person who took the picture that I marked as a favorite.
So the first picture in the table was taken by bopuc and the next three are his first three public favorites. Go one down, rinse, lather and repeat. Obviously this is a very static view and I plan to add more interaction. Some ideas that I'm tossing around are dynamically rebuilding the square when you click on an image, being able to enter a username or e-mail address for a starting point and maybe some kind of DHTML-fu where I use the XMLHttpRequest object to pull in favorites and build some kind of Boogle™ like game board without having to reload the page.
Anyway, this is how far I got last night before I went out to watch movies with "the guys." I can't spend all Friday night geeking out...
Update:
Some issues that I need to deal with:
- If the first column contains two favorites from the same person, the rows will be the same. I should pull more photos to make sure that doesn't happen.
- If the person doesn't have enough favorites to complete the row, the square effect is botched.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Sometimes random play doesn't seem so random.
Lost in a world with no reality
I'm frightened to move
I'm frightened to speak
And I will kill for a good night's sleep
I'm feeling, I'm feeling dead, dead, dead, dead
Therapy?
Die Laughing
I was very bummed when nutr.icio.us shut down. It was a better way to post stuff to del.icio.us, since it gave you a view of the tags you had already used. But, and I'm sure this isn't new, del.icio.us itself has posted an experimental way of doing the same thing. This isn't done in a pop-up window, yet. It's okay since after logging your entry, you are sent back to the original page.
Action Items For You
- Get on board with del.icio.us
- Get the bookmark
astroturfsign
Originally uploaded by kucharo.
In the grand scheme of things the Superbowl doesn't mean squat, but large numbers of people get together to watch it. We all use it as an excuse to hang out and have fun. I wasn't really excited about either team, but I decided to pick the Iggles, as Atrios likes to call them. That being said, the Patriots are probably the only team that could win this much and not piss me off. The keep fairly humble, for pro athletes anyway.
This HOWTO is incredibly similar to the docs for the KeyWordList plugin itself. I only add how to incorporate the MTIfEmpty plugin so you don't have to worry about blank output when you haven't entered any keywords on some of your posts.
First you need some MT plugins.
Now you need to modify the template where you want the tags to appear. It needs to be inside an <MTEntries> block.
<MTIfNotEmpty expr="[MTKeyWordList]1[/MTKeyWordList]">
Flickr tags:
<MTKeyWordList>
<a href="http://flickr.com/photos/tags/<$MTKeyWord$>" rel="tag"><$MTKeyWord$></a>
</MTKeyWordList>
</MTIfNotEmpty>
The MTIfNotEmpty is used to check for the existence of one or more keywords. If you don't have any keywords, you probably don't want to have any output (a dangling 'Flickr tags:' in my case). MTKeyWordList will then loop over all your keywords for that post and, in this case, make links to Flickr tags. You can obviously make links to other services (Technorati, del.icio.us, etc...) and you can do anything you want HTML-wise. I'm sure all the semantic web weenies would be screaming about how I'm not using a list for what clearly is a list. That is, if anyone read this of course.
I'm using this in MT 3.15 and I've used similar hacks in MT 2.5x - 2.6x. So you should be good to go.
Flickr was smart. Flickr had an open API from pretty much day 0. It let them concentrate on their core service and let other people fill the gaps in client-side applications. Flickr has now put up a Services page to spotlight some of the more outstanding externally developed applications.
I know that I could not live without iPhoto FlickrExport. But now I'm also starting to get hooked on FlickrFox. I know, it's very similar to 1001, only with less OS X goodness. But somehow I never seem to launch 1001 and even when I do it seems to get in the way. Mind you, this is just for me. I know a few people who think it's the coolest app since Shuffle Puck Café.
If you haven't already got a Flickr account, at least sign-up for a free one and give it a shot.
Dear Windows (all versions),
I hate you. I loathe you . I despise you. I abhor you. I detest you. You are an abomination. You are repugnant.
I wish you great harm. I wish upon you all the things I say I wouldn't wish upon my worst enemy. I wish you would bloody f*cking die a horrible, painful death. Slowly. As if somebody was cutting your heart out with a spoon.
I know I'm not the first person to have these feelings about you, but they are mine and I chose to share them with you at this time.
Love,
Pat
Just when I say I'm not going to write about politics, something so nasty comes up and I feel I have to put something down, if only to get it out of my system. Alberto Gonzales was confirmed 60-36-4. Six Democrats, including Holy Joe Lieberman, voted for torture. The GOP talking point was that Gonzales should be confirmed because he was Hispanic. Their best points are always the exact opposite of what they really think. They also claimed he was qualified. In that, they would be wrong. In crafting various positions for the White House, Gonzales has shown that he has no real regard for the principles of the Rule of Law.
Senate Minority Leader, Harry Reid, gave a passionate speech about his no vote.
But, embodying the American dream is not a sufficient qualification to be Attorney General of the United States. The Attorney General is the people's lawyer, not the President's lawyer. He is charged with upholding the Constitution and the rule of law. The Attorney General must be independent, and he must be clear that abuses by our Government will not be tolerated. Judge Gonzales's appearance before the Judiciary Committee raised serious questions about his ability to be that force in the Justice Department. That is why I am going to vote against him.
The closing part is just brutal, and you can't help but cringe when you read it, know that McCain voted for this man.
I will tell my colleagues about one of our men and what that man said about his treatment by the Vietnamese:
"It's an awful thing, solitary. It crushes your spirit and weakens your resistance more effectively than any other form of mistreatment. Having no one else to rely on, to share confidences with, to seek counsel from, you begin to doubt your judgment and your courage."
Here, I would make an editorial comment that this man knows about any other kind of treatment. He was brutally beaten, limbs broken. So he knows what he is talking about.
The man who said these words was a Navy pilot, LCDR John McCain. For John McCain and all our soldiers serving across the globe, we need to stand against torture because of what it does to us as a country, to those serving now, to the future servicemen of our country, and what it does to us as a nation.
If we fail to oppose an evil as obvious as torture -- it is an evil and it is obvious it is wrong--then as President Thomas Jefferson said, I will "tremble for my country when I reflect that God is just."
I had always opposed John Ashcroft, especially hanging around EFF for some of his choice moves. But now I understand that old saying about "the devil you know."
Not bad.
Not so hot. Pass on it, even on sale.
I'm all good now. Some things are gone. Some of them will come back, while others will not. Some links will break, while others will not. I know this is supposed to be some sort of web sin that is akin to killing kittens. So be it.
Comments are back thanks to MT-Blacklist. It's MT 3.x integration is fantastic. Bravo Mr. Allen! There is a delay while they are approved of course. I think there is a auto-passthrough for TypeKey people. I may turn that on.
I don't know why I bothered with all this. I really don't have anything to write about. My short stint into the world of fiction was, well, short. I don't want to write about work. I don't want to write about politics or music or movies or much of anything really. So, it will just sit here. Doing what it always does...get hit by my two biggest fans: GoogleBot and MSNBot.























































































































































































































