oh hai.

Eurotrip - London, Amsterdam, Berlin, Prague, Budapest, Athens

Posted: June 18th, 2009 | Author: Nick | Filed under: travel | Tags: , | 2 Comments »

I have a ton of pictures but everywhere has slow internet here which would take forever to upload.  Words are boring I know, pictures do a much better job.  I’ll add them in later when I get faster internet.

UPDATE: Finally got my pictures uploaded, check here for my Europe pictures

London - great city, pretty expensive but a really good time.  Stay at the Generator hostel, great bar in the hostel, safe and great staff. Go on the free walking tour by New London/Europe, they take you to all of the main attractions.  From there you can figure out which ones you want to go back to and explore.  Went to the Tower of London as well, really amazing and huuuuuge.  Also saw St. Paul’s Cathedral which is very impressive.  Went to the British Museum, had a lot of really cool exhibits, also an amazing building.  All of the museums in London are free so head to those if you are into museums.  Also, go to Russell square it’s a really cool park in Camden, people hang out there all day and you are free to do whatever in the parks.

Amsterdam - Went to Van Gogh’s Museum and saw Starry Night and a pub crawl through the red light district.  Really sad to see women caged up like that hehe.  There are two main pub crawls for the city, I went on the ultimate party one and not the new Amsterdam one.  Definitely recommend a pub crawl because of how sketchy the red light district can be at night.  Try to stay at the Flying Pig hostel if you go, it was all booked when I looked but it’supposed to be the best in Amsterdam. Also, I hear good things about Dampkring it’s the place that was in one of the Oceans 11/12/13 movies, there’s a picture of Brad Pitt up on the wall from his visit.

Berlin - Wasn’t a huge fan of Berlin all of the main tourist attractions were pretty cool though.  I stood above where Hitler’s bunker was which is pretty crazy to think about.  Went to an amazing club there called the Matrix, highly recommend checking it out.  If you go on the New Berlin pub crawl they take you there as the last stop.  Stayed at the generator, great younger hostel, not the best location though.  Berlin’s public transportation system is really good though.

Prague - Prague was awesome, really liked it here even though I was starting to get sick at the time so took it pretty easy.  Went to the old square which is really cool and great places to eat around there too.  Did a pub crawl here as well, got yelled at by a group of asians because I wasn’t drunk enough for their standards.  Probably had the best Chinese food ever there which I know is not local food but it was amazing and fresh.

Budapest - Stayed at this really cool hostel called the Budapest Bubble which is basically in this girl’s house which makes it feel like home instead of a crappy hostel.  Went to a festival in the park here, can’t remember the name.  The girl that ran the hostel took us out one night and we went to a really cool bar, really big and really relaxed atmosphere.  I love the bars here because they don’t blast music which means you can actually have a conversation with who you went to the bar with.  Forgot my camera this night so no pictures sorry.

Athens - You have to go sit on the rock at Acropolis at night, it’s amazing! you can see the whole city and you have Acropolis in the background.  Do not stay at a hostel here, book a hotel.  Athens doesn’t have any good hostels. Go to Syntagma square and take the tram to the beach.  I’ve heard the day trips to one of the islands is worth it too.  I’m going to be on Santorini for a week though so we didn’t opt for that.

Next stop - Santorini Island at Artemis Village!

I’m sure I’m missing a bunch of attractions here and there, we’ve covered a lot of ground so far and I’m tired from laying on the beach all day.  Traveling is a tough job I know :)

Send suggestions on where we should go next in the comments!


Capistrano recipe: update your remote shared assets and database to your local application

Posted: April 15th, 2009 | Author: Nick | Filed under: rails | Tags: , , | 2 Comments »

When working on a production site there is often a need to get the latest data from the database or the latest shared assets onto your local development machine.

Shared Assets are typically items that users uploads through some interface that you don’t want to store in your git repository but don’t want to overwrite on deploy. For example you have a user model and people can upload their avatar. We don’t want that image file in the repository but we do want to keep it on the live site.

When I talk about shared assets I mean specifically items in the public directory. These items should be in your .gitignore file as well as a symlink that is setup in your deploy recipe. A directory like public/uploads or public/images/photos. You shouldn’t be using this for javascript files, css, regular images, etc.

The live database often contains data that modifies either the content or display of your site. Various items such as blog posts, recent messages, and many other items.

Wouldn’t it be nice if you could have an easy way to make your local development site look just like the production site?

Assuming you already have a functioning deploy recipe the following is an additional namespace you can add to have this functionality. Also, make sure that you have your keys on your remote server so it doesn’t prompt you to login.

First lets setup the shared host that we want to pull this information from. We could probably pull from one of the roles but for now we are just going to use a single shared host. Modify this recipe as you see fit, this is just more of a base for people to work off of.

Specify the shared host to pull your remote assets and database from

set :shared_host, "nickhammond.com"

Now lets setup the namespace and recipe for the two tasks that we want to accomplish.

namespace :update do
  desc "Mirrors the remote shared public directory with your local copy, doesn't download symlinks"
  task :shared_assets do 
    if shared_host
      # Used friendly options so it's easier to read
      # I'm using rsync so that it only copies what it needs
      # Windows users you can use the download method within capistrano and pass recursive => true
      run_locally("rsync --recursive --times --rsh=ssh --compress --human-readable --progress #{user}@#{shared_host}:#{shared_path}/public/ public/")
    else
      puts "Ummmm. You should define a shared_host variable so I know where to get the files from."
    end  
  end
 
  desc "Dump remote production database into tmp/, rsync file to local machine, import into local development database"
  task :database do 
    # First lets get the remote database config file so that we can read in the database settings
    get("#{shared_path}/config/database.yml", "tmp/database.yml")
 
    # load the production settings within the database file
    remote_settings = YAML::load_file("tmp/database.yml")["production"]
 
    # we also need the local settings so that we can import the fresh database properly
    local_settings = YAML::load_file("config/database.yml")["development"]
 
    # dump the production database and store it in the current path's tmp directory. I chose to use the same filename everytime so that it would just overwrite the same file rather than creating a timestamped file.  If you want to use this to create backups then I would recommend putting something like Time.now in the filename and not storing it in the tmp directory
    run "mysqldump -u'#{remote_settings["username"]}' -p'#{remote_settings["password"]}' -h'#{remote_settings["host"]}' '#{remote_settings["database"]}' > #{current_path}/tmp/production-#{remote_settings["database"]}-dump.sql"
 
  # If your database is large you might want to bzip it up and then extract it later
 
    # run_locally is a method provided by capistrano to run commands on your local machine. Here we are just rsyncing the remote database dump with the local copy of the dump
    run_locally("rsync --times --rsh=ssh --compress --human-readable --progress #{user}@#{shared_host}:#{current_path}/tmp/production-#{remote_settings["database"]}-dump.sql tmp/production-#{remote_settings["database"]}-dump.sql")
 
    # now that we have the upated production dump file we should use the local settings to import this db.  
    run_locally("mysql -u#{local_settings["username"]} #{"-p#{local_settings["password"]}" if local_settings["password"]} #{local_settings["database"]} < tmp/production-#{remote_settings["database"]}-dump.sql")
 
  end
end


Easy logging with Sinatra

Posted: March 28th, 2009 | Author: Nick | Filed under: sinatra | Tags: , | 3 Comments »

Sinatra doesn’t come with any logging utilities but Rack sure does. When I’m working on a Sinatra app it’s really handy to have logging available and Rack provides multiple levels of logging that you can use in your Sinatra application.

To get a logger set up it is pretty simple. First create a configure block unless you already have one then put this code in your configure block.

configure do 
  Log = Logger.new("sinatra.log") # or log/development.log, whichever you prefer
  Log.level  = Logger::INFO 
  # I'm assuming the other logging levels are debug & error, couldn't find documentation on the different levels though
end

Now whenever you need to debug something in your application or can’t figure out why something isn’t working just send the area in question to your log file.

Log.info "WTF, why isn't this working #{@users.inspect}"


Bare Sinatra App for deploying to Passenger

Posted: March 27th, 2009 | Author: Nick | Filed under: sinatra | Tags: , | No Comments »

I’ve been working on a handful of Sinatra applications recently and I’ve deployed them all using Rack on Passenger. While Sinatra only does require one file to run on your box with mongrel, when it’s using rack with passenger it requires a few more directories and files. It’s pretty much your basic rack directory structure but it’s nice to have a bare app to work. I went ahead and created a bare sinatra application and threw it up on github to make the process faster of creating a new sinatra application.

Here’s the details of the sinatra skeleton application
.gitignore - ignore .swp and other temp files

*~
*.swp
config/db.rb


Capfile
- this is needed for capistrano to deploy. This is put here by running capify . in the directory of the application

load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'


app.rb
- The core app file. The file just includes a require to rubygems and sinatra which is all that is needed and a route or two.

require 'rubygems'
require 'sinatra'

config.ru - this is an important file since this is what rack looks at to figure out how to run your application properly.

require 'rubygems'
require 'sinatra'
require 'app.rb'
path = '' # set the root path of your app here. e.g. /var/www/username/somesite
 
set :root, path
set :views, path + '/views'
set :public, path + '/public'
set :run, false # this line tells mongrel not to run and to let passenger handle the application
set :environment, :production
set :raise_errors, true 
 
# sinatra doesn't have anything built in for logging so you can use the stdout to log to a file
log = File.new("sinatra.log", "a")
STDOUT.reopen(log)
STDERR.reopen(log)
 
# always put this line last so that all of your settings are properly loaded before sinatra is booted up
run Sinatra::Application

config/deploy.rb - contains your deploy recipe. I usually put a database connection file in here as well such as db.rb. When I need activerecord then I just put a require activerecord in my app.rb file and then a load config/db.rb to get my models connected to my database.
config/db.rb

ActiveRecord::Base.establish_connection(
  :adapter => 'mysql',
  :username => 'root',
  :password => '',
  :host => 'localhost',
  :database => 'somedb'
)


models.rb
- I usually put all of my models in here just to organize the code better. Again, this isn’t necessary for sinatra, it’s all up to however you would like to do it.

class Book < < ActiveRecord::Base
  validates_presence_of :title
end

public/images
public/stylesheets
public/javascripts

every application is going to have those three directories, might as well create them by default.

tmp/
in order to restart your sinatra application with passenger you need the tmp directory so that you can run touch tmp/restart.txt to restart your application.

views/
views contains all of my sinatra layout and action files. Sinatra uses layout.haml/erb as your default layout similar to how rails uses the application layout file. Put your sass files in here as well and create a path in your app.rb similar to the following to get your sass to compile to css.

get '/stylesheets/application.sass' do 
  sass :application
end


Rails magic form helper - create field based on type

Posted: March 21st, 2009 | Author: Nick | Filed under: rails | Tags: , | No Comments »

The following is a helper that adds onto the regular form_for helper within rails. The script below adds methods onto the default form_for to generate fields automatically based on the type of the field. If you have a really basic model you can also generate the entire form based on the data type of each column.

# put this in lib/magic_form.rb
class MagicForm < ActionView::Helpers::FormBuilder
  def input_fields(opts = {})
    object = @object.class
    columns = object.columns.delete_if {|key,value| opts[:exclude] && opts[:exclude].include?(key.name) || key.name == "id" }
    columns.collect {|o| input_for(o.name)}
  end
 
  def input_for(field, opts = {})
    field = field.to_s
    field_label = self.label(field, opts[:label])
    type = @object.class.columns_hash[field].type.to_s
 
    if field.include?("_id")
      field = self.collection_select field, field.gsub("_id","").camelize.constantize.all, opts[:option_id] ? opts[:options_id] : :id, opts[:option_label] ? opts[:option_label] : :name
    else
      field = case type
        when "string", "integer", "float"
          self.text_field field, opts
        when "boolean"
          self.check_box field, opts
        when "datetime"
          self.datetime_select field, opts
        when "date"
          self.date_select field, opts
        when "time"
          self.time_select field, opts
        when "text"
          self.text_area field, opts
        when "binary"
          self.file_field field, opts
        eles
          self.text_field field, opts
        end
    end
 
    if type == "boolean"
      "<p>\n\t#{field}\n\t#{field_label}\n\n"
    else
      "<p>\n\t#{field_label}\n\t<br />\n\t#{field}\n</p>\n"
    end
  end
end
 
# Example usage
# app/admin/views/listings/new.html.haml
%h2 New listing
= render :partial => "form", :locals =&gt; {:listing => @listing}
 
# app/models/listing.rb
class Listing < ActiveRecord::Base
  has_one :status
end
 
# app/models/status.rb
class Status < ActiveRecord::Base
  validates_presence_of :name
  belongs_to :listing
end
 
# app/admin/views/llistings/_form.html.haml
# single field usage
# f.input_for :price prints out the label along with the proper field. integer, string, float is a
# text field, text is a text area, boolean is a checkbox, date field is a date selector, datetime
# is date time selector, etc.
# f.input_for :status_id makes a label with a select field and populates the select input
# with all of the options from the status table.  The way that the helper determines the
# associated model's data could probably be improved upon, I'm sure there's a better way.
- form_for ([:admin, @listing]), :builder =&gt; MagicForm  do |f|
  = f.input_for :price
  = f.input_for :status_id
  = submit_tag "Create new listing"
 
# app/admin/views/listings/_form.html.haml
# complete form maker
# f.input_fields will make the entire form for you from Model.columns (excluding id, didn't
# want to use content_columns since that strips out all fields that have _id).  This probably
# won't be used much but it's here for really basic models where nothing too complicated is going on.
- form_for ([:admin, @listing]), :builder => MagicForm  do |f|
  = f.input_fields, :exclude => ['created_at']
  = submit_tag "Create new listing"
 
# the helper doesn't support has_many associations just has_one associations.
# This is meant to be used as a replacement for most of the simple cases for
# administering content, not for complex forms or associations.

This form builder was inspired by Merb’s control_for method which I can no longer find documentation on. Hopefully something similar will make it into Rails 3.

Let me know if you have tips on how to add on or improve the script or if you find it useful.


YM4R with multiple domains

Posted: March 2nd, 2009 | Author: Nick | Filed under: rails | Tags: , , , | No Comments »

I didn’t find this option documented anywhere until I started digging through the code within the library. I had an instance where I was using A CMS to run multiple sites that all needed a use for google maps. With the regular implementation of YM4R you would normally get an error from google maps stating that this Google Maps API key isn’t valid for this domain. By simply passing in the host option you can then use the additional api keys you have setup in your config/gmaps_api_key.rb

In your config/gmaps_api_key.rb there needs to be a key for each domain that you wish to have google maps on.

production:
 host.com: longapikeythatmakesnosense
 anotherhost.com: jsdkfljskfljsgklsjgkl

Then in your layout file you need to print out the correct API key for communicating with google maps. This can be done by just passing in the host option with the request.host as it’s value.

< %= GMap.header(:host => request.host) %>


Target blank with jquery or prototype

Posted: March 2nd, 2009 | Author: Nick | Filed under: web | Tags: , , , | No Comments »

In order for your site to be strict XHTML compliant there can’t be any target attributes for links, it isn’t a supported attribute. I can see why this is a good idea but it’s also annoying at the same time. It doesn’t make sense for when you are linking to an external vendor or site for someone to open in a lightbox or within your own site.

There are two ways around this, say f standards and put the target attribute in there anyways or make javascript do it for you.

With the methods below specify rel=”external” on any links you would like to open in a new window or behave like a target=”_blank”.

<a rel="external" href="http://google.com">Google Rocks.</a>

jQuery

$(function(){
  $('a[@rel$='external']').click(function(){
    this.target = "_blank";
  });
});

Prototype

Event.observe(window, 'load', function() {
    $$('a[rel="external"]').each(function(link){
        if(link.readAttribute('href') != '' && link.readAttribute('href') != '#'){
            link.writeAttribute('target','_blank');
        }
    });
});


Standard HTML elements for styling with CSS

Posted: March 2nd, 2009 | Author: Nick | Filed under: web | Tags: , , | No Comments »

I use the following code to demonstrate what the content of a web site is going to look like.  This goes over the typical HTML elements within a page, you might need to add more for your specific site but this should get you started.  This code can also be used as a demo to a designer on what styles you need made within the design file before it starts development.

<h1>The H1 tag looks like this</h1>
<p>The paragraph after an H1 looks like this</p>
 
<h2>The H2 tag looks like this</h2>
<p>The paragraph after an H2 looks like this</p>
 
<h3>The H3 tag looks like this</h3>
<p>The paragraph after an H3 looks like this</p>
 
<h4>The H4 tag looks like this</h4>
<p>The paragraph after an H4 looks like this</p>
 
<h5>The H5 tag looks like this</h5>
<p>The paragraph after an H5 looks like this</p>
 
<ol>
<li>This is a normal list element in an ordered list</li>
<li><strong>This is a strong element in an ordered list</strong></li>
<li><em>This is an italic element in an ordered list</em></li>
</ol>
 
<ul>
<li>This is a normal list element in an ordered list</li>
<li><strong>This is a strong element in an ordered list</strong></li>
<li><em>This is an italic element in an ordered list</em></li>
</ul>
 
<blockquote>A blockquote looks like this. Nullam nec dolor. Integer mauris metus, dictum ut, consequat vitae, bibendum vitae, arcu. Maecenas ut enim vel nunc laoreet tempus? Nulla porta ultrices nunc. Maecenas eleifend, diam eget interdum placerat, eros purus accumsan neque, a vestibulum leo enim sed quam. Maecenas mi libero, molestie in, sollicitudin sed, dapibus non, felis. Sed interdum blandit nulla. In nisi! Pellentesque lacus tortor, tempus vel; adipiscing et, egestas sed, enim. 
</blockquote>
 
<code>
A code looks like this. Nullam nec dolor. In, A code looks like this. Nullam nec dolor. In
</code>
 
<span>
This is what a span tag looks like
</span>
 
<a href="">A basic link </a>
 
<p>
A long paragraph. Nullam nec dolor. Integer mauris metus, dictum ut, consequat vitae, bibendum vitae, arcu. <a href="">A link in the middle of a paragraph</a> Maecenas ut enim vel nunc laoreet tempus? Nulla porta ultrices nunc. Maecenas eleifend, diam eget interdum placerat, eros purus accumsan neque, a vestibulum leo enim sed quam. Maecenas mi libero, molestie in, sollicitudin sed, dapibus non, felis. Sed interdum blandit nulla. In nisi! Pellentesque lacus tortor, tempus vel; adipiscing et, egestas sed, enim. Pellentesque aliquam, lectus id varius dictum, turpis dolor vehicula justo, ut faucibus dolor tortor non metus. Nam tincidunt magna non justo! Praesent nisl ipsum, vestibulum id, viverra cursus, viverra non, neque! Nullam nunc. Quisque vel nibh. Nullam vitae ante vitae diam aliquam volutpat. Nullam bibendum tellus vitae dui. Suspendisse vehicula vestibulum ligula. Nullam eget nisl.
</p>
 
<p>
Another long paragraph stacked below the one above. Nullam nec dolor. Integer mauris metus, dictum ut, consequat vitae, bibendum vitae, arcu. Maecenas ut enim vel nunc laoreet tempus? Nulla porta ultrices nunc. Maecenas eleifend, diam eget interdum placerat, eros purus accumsan neque, a vestibulum leo enim sed quam. Maecenas mi libero, molestie in, sollicitudin sed, dapibus non, felis. Sed interdum blandit nulla. In nisi! Pellentesque lacus tortor, tempus vel; adipiscing et, egestas sed, enim. Pellentesque aliquam, lectus id varius dictum, turpis dolor vehicula justo, ut faucibus dolor tortor non metus. Nam tincidunt magna non justo! Praesent nisl ipsum, vestibulum id, viverra cursus, viverra non, neque! Nullam nunc. Quisque vel nibh. Nullam vitae ante vitae diam aliquam volutpat. Nullam bibendum tellus vitae dui. Suspendisse vehicula vestibulum ligula. Nullam eget nisl.
</p>


Apache /htaccess forward entire site except a few custom pages

Posted: March 2nd, 2009 | Author: Nick | Filed under: apache | Tags: , , | No Comments »

This method demonstrates when you would like to redirect an entire site but would like to show something such as a “We have a new web site” page on the existing domain. For instance if your site is moving from http://foo.com to http://bar.com but you want people to be greeted at http://foo.com with a “Our site is new and improved and now belongs at http://bar.com, you will be redirected there in a moment.” Also if you have additional pages that need to be excluded from the redirect such as an about page or contact page, this method will work too. This same code also has a few pages that are redirected to a new relevant page.

The following code needs to go in your hosts.conf or your htaccess file. I would recommend putting it .htaccess over your hosts.conf since it is web site specific and not apache specific and would just clutter up your hosts.conf file.

# These lines should go before the rewrite condition below so that they are listened to first
# This says redirect http://foo.com/about.html -&gt; http://bar.com/about-us, notice the page name has changed and we don't want to just dump them out onto the home
Redirect /about.html http://www.bar.com/about-us
Redirect /contact.html http://www.bar.com/contact-us
Redirect /sitemap.html http://www.bar.com/sitemap
 
Options +FollowSymLinks
RewriteEngine on
 
RewriteCond %{request_uri} !^/(index|contact|about|sitemap)\.(asp|html|htm)$
#  says no! for the pages listed which would be index.html/asp/htm, contact.asp/htm/html since we want those other pages to listen to the redirects above and the index will be excluded so it can be delivered from the site.
 
RewriteRule (.*\.(asp|htm|html)) http://www.example.com/arts-culture [R=301,L]
# this line dumps the remaining requests that don't match any prior conditions to this specific page. Don't use this if you want the user to be dumped onto the new homepage.
 
RewriteRule (.*\.(asp|htm|html)) http://www.example.com/$1 [R=301,L]
# This is if you want to send over the page with the forward


Easily convert your Rails .erb files to .haml files

Posted: March 2nd, 2009 | Author: Nick | Filed under: rails | Tags: , | No Comments »

With rails there currently isn’t a way to generate haml template files instead of erb template files when generating a controller. If there is, news to me and please post in comments as I would love to know. I know this exists in Merb so this feature will probably come along with Rails 3 I would hope.

What I do is setup an alias within my bash profile so that I can call “hamlit” on the directory in question. My alias command refers to the following code.

for f in *.erb; do mv $f `basename $f .erb`.haml;done;
 
After this alias is setup I CD into my views directory in question and run "hamlit" and I now have haml templates instead of erb for rails. This function just renames the files so if you have content in there that you would like to save it will still be in there.  The code obviously needs to be updated to haml template code and not erb though.
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=8d9104c8-7223-4c70-b731-04146a125823" alt="" /></div>


23 Yahoo! APIs/Resources for your site.

Posted: November 26th, 2008 | Author: Nick | Filed under: api | Tags: , , , , , | No Comments »

While looking around for data sources for a couple of web projects I kept on stumbling across Yahoo’s API set.  Some of them are fairly popular such as flickr, maps, and music but there are quite a few other useful ones that Yahoo Provides. 

  • Answers - Provides access to questions by category, raw question queries, and questions by user. A good use for this would be if you have a product or FAQ page that provides general information about some product or application. 
  • APT(Advertising Platform) - Helps to automate tasks of buying and selling advertising, ideal for agencies and publishers. An agency could build a custom ad manager tool for their clients through this API.
  • BOSS(Build your Own Search Engine) - open search web services platform. Basically this gives you access to Yahoo’s search index on your own site, pretty nifty.  Techcrunch just implemented with Boss and they seem to like it quite a bit so far. 
  • Delicious - Since delicious is now part of Yahoo this is one of their apis as well.  Delicious is very easy to integrate with since their API just uses simple HTTP requests. Could use this for displaying the most recent articles that were saved in delicious related to some topic.
  • Finance - Pull stock information for companies and industries. 
  • FireEagle - Access to their location based social network.  You could build an AIR application to integrate with FireEagle or integrate a part of a web site with this API.
  • Flickr - duh.
  • GeoPlanet - Originally launched as the “Internet Location Platform” it’s goal is to geolocate data across the web. 
  • HotJobs - job creation and management with Yahoo Hot Jobs, candidate search and view as well.  Can also utilize the RSS feed to display job postings on your own site.
  • Local - Provides access to local business information and user reviews as well as traffic alerts. 
  • Mail - Use this to build a better interface than Yahoo’s mail interface.
  • Maps - Similar to the google maps api.  Provides flash, ajax, and map image access.  Provides more location based information than Google maps such as local listings, traffic, weather, upcoming events, and flickr photos. 
  • MediaPlayer - Put a link to an audio file on your site, this will turn that link into an embedded media player on your site. Very cool for dealing with sound clips and podcasts. 
  • BluePrint(Yahoo Mobile Widgets) - Write your mobile app once, blueprint ensures it works across hundreds of devices from the basic to the iphone. Not sure how reliable this is but awesome concept.
  • Music - Gives you access to catalog data of artists, albums, tracks, videos, and user ratings.  Can even embed a video player on your site if you want.  
  • OAuth - Use OAuth through Yahoo for authentication.
  • Pipes - Who could forget the short lived Yahoo Pipes?  Pretty cool concept actually.  Basically you can easily create a mashup rss feed.  For instance you could pull stories from digg, slashdot, and techcrunch with the category “mac” and that would be published in the RSS feed which you could then display on your site or put into google reader.
  • SearchMonkey - Put Yahoo search on your site but customize the results to be more appealing to your application.  You have control over various meta data pieces and some of the layout of a search result.
  • Travel - Lookup airfare, hotels, destinations and much more through the travel trip planner. Kayak.com is also a really good resource for this.
  • Traffic - Real time traffic alerts through a feed or over the REST Api.
  • Shopping - Search through the millions of products on Yahoo’s shopping site. Also has comparison shopping and user reviews available. 
  • Events(from upcoming) - integrates with the popular event site ‘upcoming’ allowing you to get event information, add events, edit events, add tags, search, get groups and much more information. Very useful to pull in related events for your site such as all “merb events” and place in a sidebar. 
  • Weather - Access weather data for any location for free.  Provides detailed information such as humidity, wind direction and speed, visibility, barometric pressure, etc. 

I left out a few such as the contacts API, and the Yahoo authentication API.


10 Sites that use jQuery, 12 use prototype, 4 use mootools, 1 Yahoo! UI

Posted: November 20th, 2008 | Author: Nick | Filed under: javascript | Tags: , , , | No Comments »

With the heavy use of “AJAX” and flashy javascript techniques being used on the web today, I really wanted to see who is using which javascript frameworks. This isn’t meant to be a popularity contest at all but actually to see what other major web sites are using on their high traffic production web sites.  Some sites still write all of their own custom js framework-like code for their site which has its advantages and disadvantages.  This is also meant to show you that these big name sites are using the same open source javascript frameworks that we are using on our sites.

I obtained most of the sites from off the top of my head with quite a few mixed in from the alexa top 100.

Jquery

  • bestbuy.com
  • ign.com
  • digg.com
  • typepad.com
  • nbc.com
  • kmart.com
  • passpack.com
  • amazon.com
  • dell.com
  • craigslist.org

Prototype

  • espn.com
  • fox.com
  • coca-cola.com
  • cnn.com
  • photobucket.com
  • comcast.net
  • hulu.com
  • nfl.com
  • nytimes.com
  • att.com
  • nba.com
  • apple.com

Mootools

  • wendys.com
  • about.com
  • usps.com
  • cnet.com

Yahoo! UI

  • linkedin.com