So last night I created something I was plotting to do for a while. A search page for myself that does both the google and live search engines. I'm hosting it over at Peace Love Code at http://www.peacelovecode.com/search/. Updated: Source Code posted at peacelovecode.com.
Now why did I do this? To prove live's engine is better? No. I did it cause I did google searches before working at Microsoft a lot. It is built into muscle memory. I'm at google before I even know what hit me. This was a cool way for me to see which engine gives ME better results. I search for weird stuff, technical stuff dealing with computer languages and reverse engineering query string variables that are cryptic but deal with what I'm doing.
Smooth as silk Successes:
- Dealing with the Live API's was easy. Live's API allows me to do paging and return between 1 and 50 results unlike ...
- Going from postbacks to ASP.Net Ajax callbacks are super easy. One might as ... too easy.
- I remembered how to do code without touching it for a few months. I demand a cookie for doing this.
Problems:
- UTF8 is evil.
- The Google Ajax results is a hack using their Ajax search results. Who knows how long they will allow this to work like this. They can change it and break what I'm doing at any time.
- Reverse engineering objects from JSON is hard.
- Finding the api key for Live Search was a bit harder than I thought. Microsoft calls it an AppID. It can be found at http://search.msn.com/developer.
- Google's wasn't exactly a walk in the park either if you don't enter through the front door (I didn't). Their signup can be found http://code.google.com/apis/ajaxsearch/signup.html.
- Google's Ajax Search results only give me 8 results back. I don't think there is a way to page the results also.
- Using ASP.Net Ajax, I couldn't fire off 2 Ajax requests side by side it seemed like. I know there is some way to do it, I just don't know how ... yet. This is for the "Search" button. I want both panes to update independently.
- I couldn't do a straight port of the app to ASP.Net Ajax, I know if I actually searched for this, I'd be able to convert the ASP.Net version to ASP.Net AJAX with ease.
- Installed ReSharper and am fighting with some of the key bindings, they are different than what I had at my old job.
I'm with stupid moments:
- It took me too long to figure out to do a server-side focus on a control is controlName.Focus(); I was looking for a function when there was a method call to do it right in my face.
- I blanked out once on doing CSS