Posts Tagged ‘mashup’

71Miles: Best Travel Advice Ever

Thursday, March 1st, 2007

90% of travel happens within one hour of your home but almost every travel site is focused on big trips. That’s because it’s easier for them to get a cut of a $500 plane ticket than it is of a $50 meal at some out-of-the-way inn.

My buddy (and Odeo alum) Adam just launched 71Miles, a travel site focused on giving advice for your short weekend trips. Right now it’s just Northern California, followed soon by Washington D.C. and eventually all major US metropolitan areas. Unlike my copy of Lonely Planet Italy, which has sat untouched on my coffee table for two months, this is travel advice I can actually use.

It’s a very cool site. Check it out!

If all goes well Odeo alums could be launching three new companies before summer. Nice!

Using the Salesforce API

Monday, December 4th, 2006

Just posted my Using the Saleforce API article on the O’Reilly Network:

In this article I’m going to turn a blog into a Salesforce lead generator by integrating the blog comments with Salesforce Leads using the Salesforce API, SOQL (a Salesforce-specific, SQL-like query language), and some Salesforce object customization.

If you hear the phrase “lead generation” and picture a car salesman, then you should probably step back and think about what you do when someone posts a comment to your blog. Do you try to find their blog? Google them? Go as far as emailing them? If you comment on my blog, you can be assured that I’m going to email you back.

Lead generation and tracking is a big part of any sales process and a major concept inside the Salesforce CRM. Many businesses are adding blogs to their sales and marketing activities and will want to integrate these into their existing sales process.

Introduction to Salesforce AppExchange

Monday, November 13th, 2006

I went to a Salesforce conference recently to investigate Salesforce as a platform for building applications for the business web. I liked what I saw. The tools they are building for developers fit very much with the trend toward smaller development companies (i.e. one or two people) who can focus completely on the product because the infrastructure for running the rest of the company already exists.

Today O’Reilly posted part one of my three part series on building for Salesforce AppExchange, An Introduction to Salesforce.com’s AppExchange.

YouTube API How-To

Wednesday, November 8th, 2006

What is it

The YouTube API lets you search for videos and display them on your site. For example, I use the API to pull videos tagged dance and display them on Rate My Dance Moves. The YouTube API is currently the 10th most popular API on ProgrammableWeb with 46 mashups.

To get started you need to sign up for a developer account. That will give you the developer id required to use the API.

Using the API

The major API methods are for retrieving lists of videos, which you can do by tag, user, user favorites, and featured. The information returned from the list methods is usually enough to display a video on your site. All you have to do is plug the video id into the web snippit below.


<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/ID&autoplay=1″>
</param>
<embed src=”http://www.youtube.com/v/ID&autoplay=1″
type=”application/x-shockwave-flash” width=”425″ height=”350″></embed>
</object>

Most of the information you need is in the video list methods. However, if you want a list of comments or channels for the video you’ll need to call the get_details method.

One complaint I had with list_by_tag is that the results come back ordered by relevance rather than recency. That means if you want to build a self-updating site you need to either regularly crawl the entire result set (results are paged) or sit on one of the RSS Feeds.

API Wrappers

There are good libraries for using the YouTube API with Perl, Ruby, and .NET. If you’re using another language, say Java, PHP or Python, you’ll have to write some code yourself. I’ve included links to example PHP and Python code and listed an example Ruby program that you can use as a template for whatever language you’re writing in.

There’s two competing Perl modules, but Hironori Yoshida’s WebService::YouTube and WebService::Youtube::Feeds seem best based on the recent development activity and strength of documentation. His is the only wrapper which includes support for the feeds, nice since the feeds have functionality thats not in the API (namely list by recency).

Shane Vitarana released a YouTube Ruby Gem after I’d built RateMyDanceMoves. Too bad, since it seems like the most polished of all the wrappers.

Eamonn Flynn has a .NET wrapper for the YouTube API.

There doesn’t seem to be a packaged PHP library but these two tutorials from waxjelly should be enough to get you started.
Simple PHP Script Using the YouTube API with Pagination
A More Complex PHP Script Using the YouTube API with Pagination.

ThinkHole labs has some example YouTube API code for Python users. Apparently using the API can be as simple as passing a dictionary to YouTube’s XML-RPC interface.

Code Example

I’d written my own code before the Ruby library came out. I want to show it here so you can see how simple writing your own code would be.


#!/usr/bin/env ruby
require 'open-uri'

tag = "dancing"
per_page = "100"
def_id = "YOUR_DEV_ID_HERE"
url = "http://www.youtube.com/api2_rest?" \
+ "method=youtube.videos.list_by_tag" \
+ "&tag=#{tag}&per_page=#{per_page}&dev_id=#{dev_id}&page=1"

open(url) do |f|
xml = f.read
end

doc = REXML::Document.new(xml)

elements = doc.root.get_elements("//video")
elements.each do |v|
puts v.get_elements("id").first.get_text.to_s
puts v.get_elements("title").first.get_text.to_s
puts v.get_elements("tags").first.get_text.to_s
puts v.get_elements("thumbnail_url").first.get_text.to_s
end

More Info

The Amazing YouTube Tools Collection has a long collection of YouTube tools, mashups, and plugins.

Quotes On Your Phone

Friday, September 29th, 2006

Make iheartquotes your Twitter friend and get quotes messaged to your phone every day at 10am, 3pm, and 8pm.

If you’re not ready for daily updates but find yourself alone with your cell phone jonesing for a quote you can also text iheartquotes to MOZES (66937).

This latest I Heart Quotes integration is a mashup of the I Heart Quotes API and the Twitter API. The Twitter API is new but there’s already been some cool uses, like update Twitter with your IChat status. I’m sure there will be more, because 1. Twitter is awesome, 2. the API is dead simple.

BTW, I Heart the quote that Biz dug up for his post about this on the Twitter blog.