Tuesday, August 16, 2011

Auto-playing Sound on the iPad and iPhone

I'm working on a project that involves JavaScript polling a server to check for new messages. One feature request was to have an audible alert if a new message comes in. Easy enough with HTML5 hottness:

// Declare the sound resource
var alert_sound = new Audio('path/to/alert.mp3');

// Play the sound on int he polling function
function message_load() {
    if(new_message) {
        alert_sound.play();
    }
    // Whatever else needs to be done
}

Great! We're done. Except that doesn't work on iOS because:
Warning: To prevent unsolicited downloads over cellular networks at the user’s expense, embedded media cannot be played automatically in Safari on iOS—the user always initiates playback. A controller is automatically supplied on iPhone or iPod touch once playback in initiated, but for iPad you must either set the controls attribute or provide a controller using JavaScript. (from Apple)
Well great, but I don't think a 28.3k file is going to use that much data. In order for the sound to play with an asynchronous update, the user first needs to 'initiate' the sound:

// Continuing from the code above

// Assumes you have jQuery loaded

// Check to see if the device is an iPad
function is_ipad(){
    return (navigator.platform.indexOf("iPad") != -1);
}

// The function to bind to the link above
function alert_sound_load() {
    // Loads the sound
    alert_sound.load();
    // Plays the sound so the user can hear what it will sound like
    alert_sound.play();
    // Changes the text to show the user the sound alert is enabled
    $(this).text('Sound Alert Enabled').css("font-size","80%");
}


$(document).ready(function(){
    if(is_ipad()) {
        // If its an iPad, ask the user if they want to enable the new message alert
        $('#alert_sound_container').html('Click to Enable the New Message Alert');

        $('#alert_sound_load').click(alert_sound_load);
    }
});

When the user clicks to enable the sound alert, they will hear the sound play once. Anytime the .play() method is called, even on an asynchronous update, it will play since the user initiated it.

Of course this is only good for the current session. If the page is closed or refreshed, the user will have to click to enable the sound alert again, but it has been working well thus far.

I welcome your feedback, comments and suggestions below.

Saturday, June 25, 2011

How To Handle Incoming Twilio Texts Larger Than 160 Characters

I've been working with Twilio for a few projects since the API is really easy to use. However, one issue that started coming up was incoming messages that were larger than 160 characters. Because of the way carriers handle multiple messages, Twilio has to break up and POST each message in 160 character limits.

For most applications, I store each incoming message in a MySQL database, and I wanted to store messages that are larger than 160 characters as one single message in the database. I work exclusively with PHP on the backend, and came across the sleep function, which pauses the execution of the script for the given number of seconds.

I create conversations based on the combination of the sender's phone number and the Twilio number the message was sent to, giving each a conversation id.
// Get the most recent message (if there is one)
$last = $this->convo->get_newest_msg($convoID);

First, I get the newest message available based on the conversation id. If this is the first message of the conversation, the get_newest_msg() method returns false.

// Calculate the how new the message is
$seconds = time() - $last['timestamp'];

Then I calculate the time between now and when the last message was received.

// See if there's a new message with in 10 seconds
if($seconds > 10) {
    $this->incoming->insert_message($convoID, $Body, $From);
    sleep(10);
    $newest = $this->convo->get_newest_msg($convoID);
    $Body = stripslashes($newest['text']);

    // Do anything else you need with the message
}
else {
    $this->incoming->add_to_message($last['msgID'], $last['text'].' '.$Body);
}

If the difference between the current message and the most recent message is greater than 10 seconds, I assume it's a text message that's longer than 160 characters. So I insert the message into the database, pause the execution for 10 seconds using 'sleep(10)'.

If there are multiple messages, each message is POST'd to my server every few seconds, but I've found 10 seconds to be a good length of time to wait for other potential messages.

If there is another message POST'd within 10 seconds that belongs to the same conversation (based on the sender's number and the Twilio number the message was sent to), the message is concatenated into one large message, and the database record is updated.

As a side note, I limit the 'text' field of the message table to 800 characters. If the text message is bigger than 800 characters, so be it. Text messages shouldn't be that long.

After 10 seconds, the script continues execution by getting the newest message once again. If there had been other messages POST'd within that 10 second time frame, I now have the full message text to do whatever I want with, such as forwarding as an email or triggering something else.

I'd welcome any questions, feedback or suggestions.

Monday, March 21, 2011

Customer feedback in the physical world is broken


Warning: this is going to be a self-serving post. (Who am I kidding? All my posts are self-serving.)

One of the most straight forward ways to improve your business is simply asking your customers what they want, or at least making it clear you are always open for new suggestions. On the internet, there are many technologies that make it easy to do so, even something simple like a web form, or just an email. That's all fine and dandy, but the problem is that we (well most of us) live in the physical world. We still eat food and/or do stuff at physical establishments or businesses.

So how do you collect feedback in this case? Here are your options today:
  • Either you or your employees talk with your customers
  • Have comment cards available
  • Incent customers to fill out a survey online after they get home
  • Display a phone number that your customers can call
All of these options are less than ideal. Here's why:

Talking with your customers
This is probably the best option, but it's not always practical, and there will always be a social filter censoring what information is passed on to the managers, or you as the owner. Sure, if you are talking to customers yourself, you know exactly what the customer said. What happens if it is one of your employees, who (perhaps unconsciously) doesn't tell the full story or leaves out important details of what a customer said? Plus, there's no good way to review all your feedback later on to actually make some changes, which is the whole point of talking with customers in the first place.

Have comment cards available
Okay, let's be honest with ourselves: no one fills out comment cards, especially the younger (my) generation. Then there's the logistics behind managing comment cards, making sure the necessary tools are available (a pen, the comment card itself, a box to deposit them). Once again, there's a layer between the customer and you or your managers. We all know employees have been known to "misplace" certain (read: negative) comment cards. Also, if it's something time sensitive like "Your bathrooms were dirty", what good is that a few days or weeks later when you read it? Once again though, no one fills them out anyway.

Incent customers to fill out a survey online after they get home
Once again, very few people do this. Ever since I started my most recent company, I have been participating in some of these, but have yet to actually finish a whole survey because I find that the survey is too structured. While structure produces nice data to generate reports from later, it's a pain in the ass for your customers, especially the ones who have one simple thing to tell you--they don't want to rate the appearance of your employees' dress or some irrelevant (to them) attribute of your business. Finally, the fact that you have to incent your customer to get feedback is a problem in and of itself. If I have something to tell you, I shouldn't expect to get something in return. Oh, and, not to mention, when I get home, I'm not going to remember what I'm thinking. Wouldn't you rather hear what I was thinking about the experience as I'm experiencing it?

Display a phone number that your customers can call
At a high level, this seems perfectly reasonable, but think about how involved this is for both you and your customers. Going back to the behavioral changes between generations, I, and many of my peers, prefer to email or text rather than call, granted there are times when a phone call is necessary. If I want to compliment your employee for exceptional service, a phone call isn't necessary.

So what are businesses to do? The answer lies in text messaging. Everyone (93% of Americans to be exact) has a cell phone and it's safe to assume that all cell phones are capable of texting.



The benefits of text messaging:
  • Low involvement for both you and your customers
  • Instant, real-time and two-way communication
  • Easy to archive for later review
  • Mass acceptance--in June 2010, 173 billion texts were sent
Even with companies embracing social media as a way to engage customers (which I'm not against), text messaging easily wins out:
90 percent of smartphone users send at least one text message per day, compared to only 40 percent of smartphone users who utilize social networks like Twitter and Facebook at least once per day. Source
Ready to realize the potential text messaging has to offer? Contact me or Email me.

Wednesday, September 22, 2010

How to Cold Call without Cold Calling

I'm going to try to write a blog post on my BlackBerry in class; we'll see how this goes.  I'd like to start by thanking Sam Richter (Take The Cold Out of Cold Calling) for tips on finding information using the internet.

Cold calling: does that make you cringe? Especially for people starting out, cold calling can be on the same level (well for males, I don't have a comparison for females, so feel free to chime in!) as approaching women--only I wouldn't recommend using liquid courage for cold calling. Luckily for me, I have supreme confidence and the utmost charisma, so both cold calling and meeting girls is easy as pie. I'm basically the Don Draper of our generation.

Except not. I don't like cold calling. So, I create my own reason for calling with pre-emptive research.

First things first, find your prospect. I've learned you should try to sell as high as possible. (Thanks Dan Grigsby!) Don't be afraid to contact the CEO. He or she will delegate as he or she sees fit. And remember, if you truly believe your product or service will be beneficial, you are not wasting their time.

How do you find the name? Google. Or Reference USA, Million Dollar Directory (huge subscription fees though...unelss you're a student at a university). Try things like:

  • [title] + [company name] -- CEO Target -- The first link is to an article with his name, Gregg Steinhafel
  • Check Google Finance (also a good place to find the company's main phone number)
  • Check LinkedIn to see if you can find a specific employee or at least a title
Now you have a name, it's time to find their email address. Once again, Google. Try things like, "*@*acmewidgets.com" to figure out the email format. Then you can use http://www.coveryourasp.com/ValidateEmail.asp to validate the format. For example, I searched "gregg *@*target.com" and instantly got his email.

Now create your email. The three key elements are:

  1. Subject -- it has to be compelling enough to open. Don't use standard, vague subjects like, "Product X", or "Feedback on an idea". Be specific: "Hear from your customers via text message".
  2. Keep it brief (but not too brief) -- You have to get the person excited somehow. Is this a new product concept? Be up front and tell them you're looking for their feedback as you think they could benefit from the product in X, Y, Z ways. Also, make this as personalized as possible. Don't copy/paste and mass email--that's treading on SPAM, and SPAM sucks. I generally keep it to about 3-4 paragraphs with a 2-3 sentences per, but experiment with this.
  3. Tell them you'll follow up with them in 2 days -- 2 days means business days. I wouldn't even bother mentioning anything about them getting back to you. If you really strike interest, they'll do that on their own.
The nice thing about this approach is you can do this outside of normal business hours, so you can focus on meetings and phone calls during normal business hours.

Make a simple spreadsheet with the 'contact name', 'title', 'company', 'email address', 'phone number', 'email date', 'follow-up date', 'meeting set?', and 'notes'. This will be your daily "CRM" system.

In regards to the phone number, once again, Google. I've even used Google Finance to find the companies main number, and then sometimes you'll get an automated company directory, which, if you know the persons name, you can at least get through to their assistant.

Now the fun part: making the call. Have a list of questions you want answered, and if you think it'll help, jot down some notes of what you want to say. On the follow up date, re-read the introduction email as a refresher of what you said, and then make the call. What do you say? "Hi. This is Geoff from Profit Increaser, Inc. I was wondering if you had a chance to read the email I sent you a few days ago?"

Then you'll get "Yes...blah blah blah." Or, "No I don't think so..."

If its the former, give them your one sentence pitch, and then immediately start asking questions, prefacing it with something like "just a few really quick questions" to assure them this won't take long. Don't bother asking if they have a few minutes. If they didn't, they wouldn't have answered. (I don't mean to be rude here, but asking the person if they have a few minutes gives them a perfect opportunity to end the conversation, which is bad.)

Now be sure to keep everything brief and high level. The goal is to get a meeting.

If you get the person's voicemail, leave them a quick message and tell them you'll follow-up in a few days. Also, I will generally send a follow up email referencing the original email and the voicemail you just left.

So, hopefully you'll get a few meetings. Once you got your sales meeting, now its time to push the sale and hopefully close it. How do you do that? No idea.

But seriously, every meeting is on a case-by-case situation. Just remember to sell the benefits (Thanks Lief Larson!), and more importantly, have a list of questions to get them talking about their business. Then offer your solution.

As a last resort, use this gem of a closing line: Go with your gut instinct, unless it's a 'no', in which case keep thinking about it until you rationalize a 'yes'.

Have anything to add? Please comment below!

Friday, July 23, 2010

Dude, Wells Fargo, Come On, Bro

I am not meaning to make a complaint or anything; I'd just like to point a pretty obvious flaw in one of Wells Fargo's processes. I used to use my WF credit card that came with the account, but since I switched primarily to Schwab (which has been phenomenal) a few months ago. I paid the final balance, and since you have to round to the nearest dollar for some reason when paying the balance by way of account transfer (aka. transfer from checking to the credit card to pay it), I was left with a negative balance of $0.66.

I didn't really think much of it until I got this in the mail a few weeks ago:

That's right, a check for 66 cents. So, instead of just transferring 66 cents back into my checking account, you (Wells Fargo) spent the money to mail out a paper check. Absolute best case scenario they broke even on that transaction.

Or, better yet, how about allowing me to transfer the exact dollar amount like literally every other single bank/financial institution does. I would imagine it is some kind of ridiculous banking regulation thing, and it's not as simple as I'm laying it out, but still.

And yes, I cashed it. In fact, I deposited it into my Wells Fargo checking.

Thursday, July 1, 2010

My Landlord Expects Me to Pay Rent Every Single Month?!

Let me first start off by saying that I thought this was America. Clearly, I am gravely mistaken. In the America I know and love, extortion is illegal. I am not sure what changed, but I guess there are forms of legal extortion now.

I just got off the phone with my landlord because he was asking where last month's rent is. Needless to say, I had no idea what he was talking about. I told him I've already paid him a few times over the last year since I moved in. Then he made the most preposterous, ridiculous statement I have ever heard:
You have to pay rent every month.
What the hell?! The unmitigated audacity to say such a thing...I am shocked. I was quite taken back, so I asked him, "Just how many months are you expecting me to pay you?"

"Uh, every month until your lease is up and you move out," he said in a tone I didn't much appreciate. He's acting like this is a normal thing to give some random person money every month for no reason. I mean, the apartment is already built, and it's not like he's doing anything to make it better.

So, like any other normal, rational human being with a lick of common sense, I asked him, "What happens if I refuse to pay you your 'rent fee' or whatever it is called?"

I hope your sitting down for this one...
I'll have you evicted.
Wow, my mistake. I can't believe extortion like this exists. What, is he in the Mafia? Do I have to pay him every month for protection too? Plus, is 'evicted' even politically correct? My goodness.

I asked a few of my neighbors who all said they have to pay every single month as well. What I want to know is where exactly is all this 'rent' money going? I need to get in on this whole 'letting people live in an apartment you own and then extorting money from them every single month by threatening eviction.'


Wednesday, June 9, 2010

Did You Bootstrap as a Child? No Money and Plenty of Time

I had a game-changing revelation the other day. I was thinking about my childhood among a million other things, and I realized there's a pretty solid analogy between bootstrapping as an entrepreneur and building crap when I was in my younger days.

To give a quick background, I grew up in Rochester, Minnesota. My father was a home builder for most of my younger life, so I always had access to tools and scrap wood. I basically grew up with a hammer in my hand (granted I would usually set it down when I went to bed). My family was by no means poor, but, as much as I would of liked at times, I wasn't able to buy anything and everything my heart desired. (Don't worry, I was not deprived as a child either. My parents bought me plenty of crap that I probably either took apart or broke, or both.)

This was back when I used to actually smile for pictures

Anyway, I had limited resources, but I still built some pretty cool stuff. One of the first forts I remember building was in the woods near one of our houses. It was pretty sick; it was raised off the ground and kept the rain out. Plus, I contracted my dad to help me build some roof trusses since at the time I couldn't use the circular saw. I guess my parents didn't want me to cut my hand off or something. At one point I drew up some pretty elaborate plans along with the material lists of what would have been an ultimate club house, but it ended up costing like $1500, and I sure didn't have that. This was the next best thing.

When we moved to our next house, I built a free standing clubhouse (meaning not attached to any trees). It was an L-shaped clubhouse (girls were allowed) that was pretty damn sturdy. I even put a lock on it to keep the bad guys out. I invested about $9 into this one in order to buy a 4x8 sheet of plywood for the roof, but otherwise it was made out of old pallets and some metal sheeting from an old shelf. My neighbor friend and I used to do strength tests on it by rolling a big wooden spool (like those huge spools for telephone cable) down a hill and letting it smash into the clubhouse. It held up no problem.

I remember wanting a go-kart growing up, which were expensive as hell, like in the thousands of dollars. So I decided to build one out of wood. Sure, metal has obvious advantages to wood, but I didn't have scrap metal and had no idea how to weld considering I was probably about 11 or 12 at this point. I hired (aka. forced) my little brother to help me carry materials back from a Menard's store next to our house. I think I ended up investing about $30 into this as I needed some metal rods for the axles, and a throttle control, which was just a lawn mower throttle control. I also needed a nice, thick piece of plywood for the base. It turned out to be pretty cool and I would zip around our cul de sac with it. Then some big dude took it for a spin and bent the axle. I'm still waiting for him to replace that.

Drill baby, drill.

I guess I'll try to get to a point now: when you think of bootstrapping a startup company, get in the mindset of a kid with no money and a lot of time.

  • What from your environment can you "borrow"? 
  • What are the things you simply need to buy? 
  • Who around you can you convince to work for free? 
  • What's a simple and cheap/free way to test your product?
  • What resources do you have access to already?