Apr 25 2009

Combining Highrise and Twilio -- Taking notes has never been easier

Category: ProjectsKurtis @ 14:15

Twilio is a "telephony in the cloud" service that allows developers to write code to create telephony apps.

Highrise is an online contact management system created by 37 signals.

I've developed a system that combines the two to record phone calls and place appropriate notes within the highrise system for select callers. Here's how it works:

  1. I programmed my cellphone to forward all calls that receive a busy signal (ie. I hit the 'reject' button) to my twilio number.
  2. When a caller gets sent to my twilio number, twilio records the call and sends it back to my cell.
  3. I accept the call.
  4. When I hang up, twilio posts the url of the recording to my server.
  5. My server then grabs the recording from twilio and puts it on Amazon S3.
  6. The server looks up who the caller was and puts a note on highrise under that caller containing a link to play the audio file.

That works great for when a client calls and I'm not in a position to take notes. I can still accept the call and review it later. I developed this system for that need, but lately I've become more dependant on it, because it is so nice to make calls without having to take notes right then. You can review the call later if necessary. So, I developed a similar method that allows me to initiate recorded calls, with a little voice recognition snazziness.

  1. I call my Twilio number.
  2. It recognizes that it's me calling and says "Who would you like to call?" 
  3. I say "Bob Jones".
  4. It matches my audio against the list of contacts in my Highrise account and grabs the appropriate phone number.
  5. It says "Calling Bob Jones at Work... 903-555-5555 If this is wrong, press any key now"
  6. If I press a key, it starts over; otherwise it calls Bob.
  7. Repeat 4-6 in the previous list.

Right now it calls the first number listed under that contact. I would like to expand the system so I say: "Call Bob Jones at Work" and it calls Bob's work number or "Call Bob Jones at Home" and it calls Bob's home number. Also, it would be nice to have a simple way to store voice notes for a contact. For example I call my Twilio number and say "Note for Bob Jones" the system responds "Recording" then it ramble on about the meeting we just had. It would also be useful to initiate todo items via phone. I call and say "Make ToDo reminder 4:45" the system response "Go ahead" and I say "Pickup River at 5:00." Then at 4:45, twilio calls me and plays the audio I recorded: "Pickup River at 5:00".

To add to this, I would love to be able to more accurately convert a dictation to text. I've been able to pretty accurately be able to recognize commands from a small list, but the dictation recognition is pretty inaccurate. It gets maybe 5% of the words correct on a phone conversation. If anyone has any suggestions, I'll take 'em.

 

Tags: ,

Apr 24 2009

Get Website Thumbnail in C#

Category: C#Kurtis @ 07:30

Ever needed to generate a thumbnail for a website? Well I have. I looked around on the net and found some code that would do just that. I put that code on my server and created a simple web interface for generating thumbnails: http://kurtiswelch.com/util/DownloadThumbnail.aspx

If you are interested, attached is the code I found.

Here is how this class is used:

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
using System.Diagnostics;

namespace GetSiteThumbnail
{
    class Program
    {
        public delegate void WebBrowserDocumentCompletedEventHandler(object sender,
            WebBrowserDocumentCompletedEventArgs e);

        [STAThread]
        static void Main(string[] args)
        {

            if (args.Length < 2)
            {
                MessageBox.Show("Usage:\nGetSiteThumbnail.exe "+
                        "http://www.yoursite.com/ thumbnail.jpg [browser_width"+
                        "(defaults to 800) browser_height (defaults to 600) ] "+
                        "[thumbnail_width thumbnail_height]\n\nSample:\n"+
                        "GetSiteThumbnail.exe http://www.cognifide.com/ "+
                        "cognifide.jpg 1280 1024 640 480\n\n",
                    "Get Site Thumbnail");
                return;
            }

            int width = 800;
            int height = 600;

            if (args.Length > 2)
            {
                width = Int32.Parse(args[2]);
                height = Int32.Parse(args[3]);
            }

            int thumbwidth = width;
            int thumbheight = height;

            if (args.Length > 4)
            {
                thumbwidth = Int32.Parse(args[4]);
                thumbheight = Int32.Parse(args[5]);
            }

            WebPageBitmap webBitmap = new WebPageBitmap(args[0], width,
                height, false, 10000);

            if (webBitmap.IsOk)
            {
                webBitmap.Fetch();
                Bitmap thumbnail = webBitmap.GetBitmap(thumbwidth, thumbheight);
                thumbnail.Save(args[1], ImageFormat.Jpeg);
                thumbnail.Dispose();
            }
            else
            {
                MessageBox.Show(webBitmap.ErrorMessage);
            }
        }
    }
}
 

 

Downloads:

WebPageBitmap.cs (7.09 kb)

Program.cs (1.93 kb)

GetSiteThumbnail.zip (55.66 kb)

Tags: