travis johnson

Archive for the 'Programming' Category

May 12, 2007

Wilco Shows Pipe

Wilco Pipe

I’ve been wanting to try out Yahoo! Pipes for a while, but never quite knew what to do. In honor of Wilco’s new album being released on Tuesday I decided to create a pipe of their upcoming shows. I don’t quite know how to put the map on my site, so until I figure that out, you’ll have to check it out on the pipes page.



 

1 Comment » Categories: Music, Programming

March 19, 2007

The new Swap-bot Forums

I spent most of the weekend working on Swap-bot, fixing little bugs and adding small features. In between the small tasks I was able finally get the Swap-bot Forums finally added. The Forum is something I started writing a while ago, but never got around to finishing.

It’s built on top of the Zend Framework, which allowed for pretty fast development. When I started working on the project, I wanted the Forum to be some separate bit of code that I could make available to anyone, but decided yesterday it might be a while until I release the code. To make the application useful for Swap-bot I had to write some pretty Swap-bot specific code right into the core and getting rid of that code might take a while.



 

7 Comments » Categories: Programming

February 19, 2007

Swap-bot switched servers over the weekend

I spent most of Saturday moving Swap-bot to its new server. In the past, moving servers wasn’t too big a deal since I never really got any traffic. A day or two downtime wasn’t anything I worried about. But, the reason I had to even move in the first place was because Swap-bot has started to decent amount of traffic. On the old host, when Swap-bot would go down for a couple minutes I would hear about it from the users. With this move, a day or two downtime was not a real option. I luckily came up with something that resulted in about 2 minutes of downtime and it would have been shorter, but I took about a minute to track down a typo I made.

The reason coordination is even an issue is because changing a domain’s DNS records takes time to propagate throughout the internet. It isn’t instant and it doesn’t happen at the same time for all users. So at the exact same time one user could be browsing the new server and another could be browsing the old server because they are using different nameservers that have different information for my domain.

The first thing I had to do was setup the new server and test it. One mistake I made when setting up Swap-bot in the first place was setting up the SVN repository on the swap-bot.com domain. Once my DNS was changed, I would have no way of getting to the repository on the old server. So, the first thing I had to do was create a new repository on a different domain. The next step was to check out the swap-bot code and copy over all the user images from the old server. To copy everything over I chose to use rsync. rsync allowed me to copy everything over and then continually check for new images added throughout the day. Anything new that was added could easily be transfered over to the new server. Over the last year, we have accumulated nearly 1 GB of images, so copying the images over multiple times wasn’t something I really wanted to do. After transferring over a copy of the database to the new server, I added a record for the new server in my /etc/hosts file, telling my computer which IP address to use for swap-bot.com, instead of asking some other nameserver for it. This way, I could go in my browser to swap-bot.com and look at the new server. I found a few minor things that needed to be changed based on the way the new server is setup, but nothing major. It looked like everything was ready to go.

Then came the moment of truth. I was ready to make the switch. To do this, I setup my new mysql server to accept a remote connection from the old host. I then shut swap-bot down and transferred the database from the old server to the new one. Updated the database information on the old host and started swap-bot back up. At this point, swap-bot was now running on the old server, but pointing to the database on the new host. This way, I wouldn’t have to worry about any data syncing issues as DNS records changed at random throughout the next 24-48 hours. I gave a quick test of the old site and everything looked good, so I updated my DNS records to point to the new server.

It was actually a pretty uneventful move. I had a few people using AOL have a little trouble because, I think, they would get switched from one server to the other at random, but that was about it.



 

1 Comment » Categories: Internet, PHP, Programming

October 23, 2006

Microsummaries

I downloaded Firefox 2 this weekend, but haven’t done too much with it. Tonight, I was looking at the Firefox 2 for Developers and saw a very promising feature: Microsummaries. Rather than me try and explain them, I’ll let Mozilla:

Microsummaries are regularly-updated short summaries of web pages. They are compact enough to fit in the space available to a bookmark label, they provide more useful information about pages than static page titles, and they get regularly updated as new information becomes available.

I am sure I will try them out before next season rolls around, but microsummaries will be perfect for The Bet site. If microsummaries could read cookies it would open the door for unlimited uses, but a quick search around the site and it doesn’t look like cookies are accessible. As time goes on, I’m sure people will come up for some great uses of this pretty neat new feature.



 

1 Comment » Categories: Programming

April 13, 2006

A night filled with Swap-bot

I spent a good portion of the night working on Swap-bot. I added a few new features tonight.

On a related note, I apparently have the best job in America.



 

4 Comments » Categories: Programming

April 1, 2006

Swap-bot widget

swapbot-widget.png

I took an initial attempt at a swap-bot recent swaps widget today. The code and graphics are heavily borrowed from examples on Apple’s site, but at least it’s a start. Get the widget.



 

1 Comment » Categories: Programming

March 7, 2006

Swap-bot development blog

I started a swap-bot dev blog tonight. As development gets into the fun stages of releasing new features, I needed an easy way to make announcements. Grab the RSS feed and watch the updates roll in.

On a related note, I went to download Wordpress and saw they now have SVN access. This is going to make upgrading so much easier!



 

2 Comments » Categories: Programming

March 4, 2006

Zend Framework Update

I got some time to play around with the Zend Framework today and I am not exactly crazy about it yet. I think that once some of the bugs get worked out it is going to be great. That said, I have decided not to use it right now.

I tried ZendServiceFlickr out and it was really slow. I wrote my own code that essentially used the Flickr API in the same way and it was much faster than Zend’s. Also, just getting the Flickr stuff to work, I had to go into their code and fix a few bugs.



 

No Comments » Categories: PHP, Programming

March 4, 2006

Zend Framework

I saw today that Zend has released its Framework for download. I guess I don’t really know where to start playing with it. I am most excited for ZendXmlRpc, ZendPdf, ZendJson, ZendInputFilter and maybe ZendFeed. I also am curious how ZendController and Zend_View work. I have played with MVC’s before and ended up not really liking them because they were too restrictive. With Zend’s, I like that it says you can use a third-party template engine (like Smarty, maybe). I hope they get SVN access working soon. It will make it a lot easier to update the framework as they add new components.

I plan to play around with it and see what I can get working. I will keep you posted.



 

2 Comments » Categories: Internet, PHP, Programming

March 4, 2006

More YAHOO.util.Connect.asyncRequest

I recently wrote about YAHOO.util.Connect.asyncRequest from Yahoo and how I used their code for some Ajax. My one problem with my solution was that my callback object was “outside” of all my other code. Today, I came up with such a simple solution. Just delete the callback object and in place of where the connection request asks for a callback object, just use the “this” pointer. Here’s my updated code.

var sentItems =
{
    success: function(o)
    {
        var sent = 
            document.getElementById
            ('items_sent_'+sentItems.swap_id).
            innerHTML = "Sent!";
    },
    failure: function(o)
    {
        alert(o.statusText);
    },
    click: function(url,id)
    {
        sentItems.swap_id = id;
        var cObj = YAHOO.util.Connect.asyncRequest
            ('GET',url,this,null);
    }

}

You must have a success and failure function (and they must be named exactly that) in order for this to work. That’s it.



 

1 Comment » Categories: Programming

Next »

  • hack day

    hackday2008
  •  

  • mybloglog

  • facebook

  • linkedin

    View Travis Johnson's profile on LinkedIn
  • flickr

    www.flickr.com
    This is a Flickr badge showing public photos from travisjohnson. Make your own badge here.
  • RSS del.icio.us

  • Kansas City v0.01 | Wordpress