Monday, September 5, 2011

The REST Tester

Back in March, I was experimenting with DOM and XPath stuff in my labs and created a little utility called the DOM Viewer. The DOM Viewer was a very specific utility that was only geared toward grabbing XPath values, and for that it worked like a champ. However, I found myself wanting to dig deeper into HTTP requests - adding POST values, new header fields, authentication, etc.

In the past, if I wanted to experiment with low level HTTP requests, I would code something from scratch using php and cURL and var_dump my way to victory. However, low level HTTP debugging is becoming increasingly important with the addition of so many RESTful APIs on the internet these days, so I decided to develop a new product called The REST Tester.

The REST Tester is a simple utility designed to help web developers debug RESTful API calls. The main purpose is to let web developers see what they're working with before they start cracking into the code. As of right now, you can call resources that return any kind of text data in the body of the response. I've also added support for image MIME types, so if you call a resource that returns binary image data, you should see the image in with the response.

In the works are Cookie values, custom header values, multiple HTTP Authentication methods, multiple HTTP request methods (DELETE, HEAD, etc.), and support for other content types. I also want to add some formatting to structured responses like JSON or XML. This is definitely just the beginning. If you have any suggestions or comments, please email me [at] troyswanson [dot] net.

Sunday, April 3, 2011

HTML5 Upgrade

I spent most of yesterday migrating troy swanson dot net to a new HTML5 codebase. It's nothing crazy, but I was able to clean up the markup and CSS pretty good. While I was at it, I decided move away from an image-based logo at the top of the page to a CSS3-based @font-face version.

Saturday, March 19, 2011

DOM and XPath

I've been working on a project that will help college students plan their upcoming semester by providing a easy-to-use system to filter through courses they need. One of the features of this project is that it will automatically grab the latest schedule data from a web page (or a series of web pages). The most complicated and cumbersome method of scraping HTML from a web page involves writing a custom routine to find exactly what you need.

I've already used php's SimpleXMLElement extension to pull posts from this blog (which is hosted by Blogger) and put them into a local database. But that was XML, and the web page that has the schedule data is in (ir)regular HTML. So, I decided to work with the DOM extension in php. In my trial-and-error experimentation with the DOM extension, I cooked up a little utility in the lab that shows the DOM tree according to the DOM extension, along with the attributes of each element.

Once you create the DOM document object, the next step to get the data you need is to locate it using XPath. XPath is a W3C standard that can determine exactly where in an XML (or in this case, HTML) document to point. I'm slightly embarrassed that I've never used - or even heard of - XPath up until now. However, now that I know all about it, I think I'll be using it a lot more.

Meanwhile, my schedule searching project is coming along nicely. I hope to have it up and running by the time Fall registration hits.

Saturday, October 30, 2010

Coldcreek Design & Landscaping

I worked with another designer on a website for Coldcreek Design & Landscaping. The design goals of the project were to maintain an elegant look around earthy colors, and I believe they were very handily met. Some features include an AJAX-powered contact page and a custom-built image management system.

Tuesday, October 26, 2010

Facebook's Camp Hackathon at UT Austin

The good folks at Facebook, notably Paul Tarjan, hosted a Hackathon competition at UT Austin a couple weekends ago (Oct 15-16, to be precise). Even though I wasn't allowed to win the Grand Prize since I'm not a UT student, I was still able to team up with a few grad students and hack something together. The project we built was called PicStrmr.

PicStrmr was a real-time service that searched public APIs from TwitPic, Facebook and Flickr based on a term specified by the user. The service would update the page with new pictures as they were uploaded. The overall effect was pretty cool and we won "Best Open Hack."

Thanks to Facebook and Paul for putting the event together!

Sunday, October 24, 2010

New Blog (Finally)

I registered troyswanson.net in April of 2005, and I have since used this domain to continually and relentlessly hone my php chi. It's gotten pretty good, but I haven't really been documenting any of my work. Hopefully that will change, now that I finally have set up a blog (and integrated it into my site). I've been doing more and more stuff with Facebook lately - namely created my own custom Facebook and OAuth 2.0 classes - and am pretty excited at the next couple projects I have in mind.

The first project is a custom Facebook skin that will have full functionality through the various API methods that exist. Facebook is awesome but I've never been a huge fan of the UI decisions they have made. I feel it can look a lot cooler and I'm gonna try to do that.

The second project is kind of secret for now, but I'll write more about it when it's appropriate.