Happy Halloween!

This is my first brush and ink drawing in probably a year. Sad fact, that.

This is my first brush and ink drawing in probably a year. Sad fact, that.
A question was posed in the comments on my JSON Feeds For Fun and Profit Part 2 - Callbacks with Twitter post about handling Twitter search results for a #hashtag. As with the rest of Twitter's API, dealing with search results is relatively straightforward. This post will examine how to handle a #hashtag search.
If you're not familiar with JSON or callbacks you might want to read the above referenced post to get up to speed.
Otherwise… it's on.
With the previous example in mind, the only real difference between this and the status request is the format of the returned object. Let's take a look that should clarify the differences.
This is the status structure:
And here's the structure for the search object:
As you can see they're related, but different. So need to use a different approach to get to the data. Here's how I'm doing it…
function twitterSearch(obj) {
//this is the div I'm writing the content to
var tDiv = document.getElementById("twitter");
var user, bgcolor, tweet, postedAt, icon, userURL;
//start the ul
tDiv.innerHTML = "<ul>"
for (i=0;i<obj.results.length;i++) {
//Look at me use the JavaScript modulus operator to do even/odd rows.
if(i % 2) {
bgcolor="#efefef"
} else {
bgcolor="#ddd"
}
//we need to get some data out of the object
//and populate some variables.
//i could do this inline in the string below,
//but this is way easier for you to read
icon = obj.results[i].profile_image_url;
user = obj.results[i].from_user;
userURL = "http://twitter.com/"+user;
tweet = obj.results[i].text;
postedAt = obj.results[i].created_at;
//and here I mash it all up into a fancy li
tDiv.innerHTML +="<li style='background-color:"+bgcolor+"; background-image: url("+icon+")'><strong><a href='"+userURL+"'>"+user+"</a></strong>: "+tweet+" <span class='time'>("+postedAt+" GMT)</span> </li>";
}
//and close the UL
tDiv.innerHTML += "</ul>";
}
//this is basically the same function I was using before
//with the changed search URL
function twitter() {
var twitterJSON = document.createElement("script");
twitterJSON.type="text/javascript"
//here's the search URL
twitterJSON.src="http://search.twitter.com/search.json?callback=twitterSearch&q=%23css"
document.getElementsByTagName("head")[0].appendChild(twitterJSON);
return false;
}
And this is what it looks like (click the link for twitter magic):
I haven't shared random bits of Internet with you for months. That changes right now.
A better solution than the deferred <script> technique I was using. I've already wrapped it into our internal library.
A great, if not ready for pime time, layout technique. Going back to the future by using the table-based display types for your grids. Party like it's (a standards compliant) 1999.
If you care about such things (and you really should you know.)
I'm being driven a little nuts waiting for some of these to be rolled out. The AdSense integration is especially interesting to me, but almost all of them will get used in one way or another (either here or at work.)
Start here:
Obscure Roxanne battle records fortnight part 1:
and finish here:
Roxanne Battle Records
Know who else is eying the Giro? None other than American Lance Armstrong…
Which means the Giro will be nuts this year. The Italian press was going to be there in droves anyway, covering Basso's return with real intensity. Now, with Lance showing up with his sights on winning, the rest of the world will be there as well.
It will be a zoo.
Can't wait.
It's been a very interesting season so far.
Nutty, I know, but imagine the three teams cannibalize themselves going 10-9 in their respective season series and in a weaker division the second place team swoops in to steal the Wild Card.
That'll do for now. More later.
Against the Day Pynchon is a madman. This work, more than 1000 pages of meandering epic, is all the evidence one could ever need of that. Frighteningly dense and wildly imaginative, Against the Day spans three continents, more than 25 years and features a dizzying cast of characters. Shifts in tone, style and focus are commonplace and serious answers to questions as basic as "what is the plot" and "who is the protagonist" would take far more space than I'm planning on devoting to this particular review.
And therein lies some of the appeal of this book for me. It's a delirious intellectual exercise trying to keep up with Pynchon on this journey through time, space, and world history. The uncertain footing and the massive breadth of the book make for challenging reading. You're constantly questioning and evaluating everything.
On the flip side, would I recommend it to other people? If you've already experienced and anjoyed Pynchon I'd say "give it a shot." It's not as good as something like Gravity's Rainbow, but it's still Pynchon.
For everyone else, I'd say "probably not." It's not a masterpiece like the aforementioned Gravity's Rainbow, so the payoff for all the hard work probably wouldn't be worth the effort for most folks.
I hope all my NYC people are going to make it over there to check it out.
The Village Pet Store and Charcoal Grill
As a side note, the cover story this month in ArtNews is about Street Art. Cool.
Quick review?
It kicks ass.
It's tiny but comfortable, looks really nice and I'm happy to be able to mess around with Ubuntu whenever I want to scratch the Linux itch without relying on virtual machines.
It will also travel really well. Compare it to my workhorse:
Which would you rather have in your carry-on?
I just got a package in the mail full of some incredible photos of me and my cohorts skating in the 1980s. I'm going to be slightly off the grid for a couple of days, but when I get back prepare to be amazed.
Okay, maybe not amazed, but they're really cool photos. I swear.
I've said it before. I'll say it again. I love drawing Swamp Thing.

I've got a lot of good written content coming up over the next few weeks and I don't think the imagery is going to slow down either so keep your eyes peeled for some cool stuff around here.