The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Look Ma, No Server-Side!

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Dave Hoover

Posts: 93
Nickname: dsrhoov53
Registered: Mar, 2004

Dave Hoover is the Lead Consultant for Obtiva
Look Ma, No Server-Side! Posted: Jun 12, 2008 6:13 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Dave Hoover.
Original Post: Look Ma, No Server-Side!
Feed Title: Red Squirrel Reflections
Feed URL: http://redsquirrel.com/cgi-bin/dave/index.rss
Feed Description: Dave Hoover explores the psychology of software development
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Dave Hoover
Latest Posts From Red Squirrel Reflections

Advertisement

When I launched the sexy http://polyglotprogrammers.com page, I decided that it would only serve static HTML and JavaScript. I thought it would be an interesting constraint that would help me break out of my server-side tendencies. So I mashed in a Google Calendar and a badge that shows the latest posts from our Google Group. I was happy with how easy this was.

And then we launched Polyglot Programmers of Chicago and had our first meeting. Being the lazy organizer that I am, I didn't ask anyone to RSVP and we ended up ordering too much pizza and stocked too much beer. I pondered aloud at a recent Obtiva geekfest about my need for an RSVP system without any server-side dependency and Renzo suggested we use Twitter. Coming off of a couple weeks of obsessive Twitter hacking, I was keen to try it. (The Twitter API is a programmer's playground, add a <canvas> tag, and it's a programmer's amusement park.) So I hacked together our RSVP system in 10 lines of client-side code. First, I provided the link to submit the RSVP:

<a target="_blank" href="https://twitter.com/home?status=@polyglots+@ppoc+June+2008">RSVP to this meeting via Twitter</a>
Then, I read the RSVP's:
<script type="text/javascript">
function rsvp(json) {
	var confirmed = document.getElementById("rsvp")
	for (var i = 0; i < json.results.length; i++) {
		confirmed.innerHTML += '<img src="' + json.results[i].profile_image_url + '" /> <a href="http://twitter.com/' + json.results[i].from_user +  '">' + json.results[i].from_user + "</a><br />"
	}
}
</script>
<script type="text/javascript" src="http://summize.com/search.json?&rpp=100&callback=rsvp&q=@polyglots+@ppoc+June+2008"></script>
You'll notice I used Summize, which sits on top of Twitter and provides an excellent service for searching through Tweets in real-time. It's funny, when I code stuff like this I feel like I'm cheating. It's freeing to only need to think about the client-side and let the service providers worry about the rest.

Read: Look Ma, No Server-Side!

Topic: Nginx: 4to lugar en Netcraft cortesía de WordPress.com Previous Topic   Next Topic Topic: Announcing new plugin: rake_commit_tasks

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use