2
September 18, 2013

Fun with Spotify Apps: Skip any song by Pitbull

no-barking

Introducing “No Barking!” my first Spotify App. Instead of having to press next whenever Mr. Worldwide comes on, the App just skips ahead to the next track. I’ll be submitting the application to the Spotify App Finder, but I have a feeling they won’t be as enthused about the whole “skip Pitbull” idea as I am. So, in the meantime, you can download the development bundle and load it on your own computer.

Download on GitHub

You’ll have to turn on “Developer Mode” for your account. Here are the quick directions for getting this app installed in Spotify:

  1. Sign up for a developer account on Spotify
  2. Open Terminal, mkdir ~/Spotify
  3. cd ~/Spotify
  4. git clone git://github.com/brianshaffer/skip-pitbull-on-spotify.git
  5. Download the latest version of Spotify
  6. Open Spotify and type “spotify:app:bad-dog” in the search bar (restart Spotify completely in case it doesn’t find the App at first)

BEWARE: If you get too close it’ll bark at you.

4
August 23, 2013

How to fix WordPress to Tumblr video importing

Videos on Tumblr come in all shapes and sizes. Youtube & Metacafe videos are done in iframes, directly uploaded ones in  html5, and then there are all the Javascript players in between. If you’re having issues with the videos importing, it most likely is because of the way WordPress sanitizes the Tumblr posts.

WordPress removes iframes from posts

That’s the main issue. Luckily, there is a solution to disable the WordPress filters while you’re importing.

Below line 411 in tumblr-importer.php, add this line:

kses_remove_filters();

Making your code look like:

do_action( 'tumblr_importing_post', $post );
kses_remove_filters();
$id = wp_insert_post( $post );

And then down on line 434 add this:

kses_init_filters();

Making your code look like:

$this->save_vars();
kses_init_filters();
} while ( false != ($post = next($imported_posts) ) && $this->have_time() );

The kses filters are in place to help prevent malicious code from being imported, and the code above simply disabled them before the import, and then reenabled them once it was completed. Since we probably trust YouTube and the other video sources, we’re allowing the iframes to live inside posts.

You’ll have to do the same modifications if you’re importing drafts. Just add the code to lines 482 and 494 respectively. You can download the importer with my modifications here (make sure you remove the .txt extension).

0
August 2, 2013

Record phone calls, from any device

Record Phone Calls

There have been many times that I wish I had been able to record a phone call. Negotiations, complex customer service requests, the last conversation with my grandpa before he died – all things I wish I could have saved. I’ve searched for iPhone apps to do this, but Apple doesn’t let developers touch and tweak the Phone application.

So I created SecureSpeak.com. It’s a way to record phone calls by doing a 3-way call – you, the person you want to call, and the recording phone line. After you hang up, an mp3 of the recording is emailed to you. Super. Simple.

There are similar apps out there, but all of them require you to know ahead of time that you want to record the call. The way SecureSpeak is designed, you can conference in the recording line at any time during a call, and not have to record 10 minutes of pleasantries before getting to the core of the conversation.

The ones for iOS are mostly VOIP, and depending on your data signal, can lead to some pretty low quality recordings. This system purely uses the phone waves, and leads to higher quality and more reliable calls.

So check out the site and look at how to record phone calls. Starting plans are just $14.99/month, and is worth every penny when you can present concrete evidence in a sticky situation.

4
June 30, 2012

Using Twilio to extend the functionality of Siri

Siri is great for playing music from your iPhone. But if you don’t have the song on your library, Siri can’t go and play it on Spotify, Pandora, Grooveshark, or any of the other players (for now). But if Siri can send a text message to a Twilio number (which I called “Siri Tunes” in my address book), that number can reply with a message linking to an mp3 that can be opened in QuickTime. Watch the demo of the application:

I love building Twilio applications. Contact me if you’re interested having a Twilio application created.

2
April 12, 2012

Using Keyword Rankings to Measure SEO Success

BrightEdge vs AWR

Using keyword ranking positions as a measure of SEO success isn’t perfect. Do you track 200 keywords, or 2000? Do you include branded keywords that you’ll likely rank for anyway? What do you do when you want to add new keywords? And then there’s the issue of customized search results. Is one scrape from one IP a good measure of the actual position?

I’ve used three different keyword ranking tools to gather this data – AdvancedWebRanking (AWR), BrightEdge, and to a small extent Positionly. Each has their pros and cons, but all can be leveraged to gain insight on your SEO performance.

AWR is great, and is probably my favorite and the most complete seo software package of the three. The thing I like most about it is that I understand how it gets the data. It runs locally on your computer, and scrapes the rankings directly from Google. I know it’s using my IP and I know what time it crawled. That’s valuable information when I need to explain fluctuations to a client – “Well, the report is from Monday morning, but if you search now for ‘cloud hosting’ you’ll see that you’re back at position 2.” With BrightEdge, when you export or compare data you can’t select rankings from a specific day, just for an entire week. I have no idea if the reported position was pulled on Sunday or Thursday.

Search results continue to become more and more tailored to the individual user. A searcher from New York will see different results from a user in Vancouver – even if neither is logged in. With AWR running locally, I know that the results I’m seeing are from my city, and to take that with a grain of salt. In BrightEdge, I need to take that gain of salt blindly, as I do not know how they’re getting the rankings. Fortunately, you can customize the search engine being used in both. There’s a lot of other factors that go into the personalization of results, but with being able to do things like see the user agent of the scraper, there’s just more transparency with AWR.

One of the things almost every SEO I know misses when thinking about keyword ranking software is the imperfection of the data. All of these tools are scrapers. They’re pinging Google and interpreting the results. Google doesn’t like this. Robots, hitting up their servers, not viewing ads, to reverse engineer their rankings? Aww hell no. These spiders frequently time out or get blocked out with a captcha by Google. I’ve been using AWR and BrightEdge in parallel for the past 3 months, and this happens in both… a lot. That’s the reason we use both, so that if one messes up, we’ll hopefully have solid data with the other. The only thing is, AWR tells you when it fails and on what keywords it failed. BrightEdge doesn’t, and will often show a stable keyword dropping from the first page to the tenth.

AWR does a better job with transparency. BrightEdge does a better job with user experience and ease of use. AWR has to be running on your own machine, while BrightEdge is SaaS on the cloud. I like the ability to automatically create customized reports with AWR (and then send them via email or push them to an FTP server), but BrightEdge is way better when it comes to grouping keywords and exporting to Excel. To me, having accurate data is way more important than saving a few seconds when sorting it.

Positionly is only in the beginning stages, but I feel it holds real promise. They have a great email alert system, and are at a way more practical price point than BrightEdge. If they can combine the best of both, I think we’ll see a worthy competitor emerge.

If you’re using any of these three, or a completely different solution, let us know what you thought.

1
November 16, 2011

Load External Content in Tumblr Sidebar

I was creating a theme for a Tumblr blog and wanted to embed a list of upcoming events. The ideal solution would be a Google calendar, but the only way to do that was via an iFrame, which style-wise would just not do. The events needed to be editable by someone who has no HTML knowledge, and fit in as inline content. The creative workaround is to create a sub page in Tumblr, use the jQuery .load function, and specify the div you want to grab content from.

Here’s how you do it:
1. Embed jQuery in your blog

<script type="text/javascript" 
    src="http://www.google.com/jsapi"></script>

2. Set the id of the div that you want to load the external content into, the url of the page you’re grabbing content from, and the id of the div that the content lives in.

<script type="text/javascript">
  google.load("jquery", "1.3");
  google.setOnLoadCallback(function() {
    jQuery(function($) {
      $("#events").load("/events #eventsHere");
    });
  });
</script>

3. Create a new page in tumblr, and wrap the content in the div with the id you specified in line 5 from step two. For me, this is #eventsHere.

Voila! You’ve got your blog fetching the content from your other tumblr page, which can be edited with their friendly WYSWIG editor.

2
November 7, 2011

BigCommerce Customize Compare Products Page

We can’t tweak the snippet used to print out the info on the compare products page. My client wanted to get rid of the “Availability” and “Brand” rows on the compare page of his BigCommerce shop. Since BigComemrce doesn’t even give relevant IDs or class names to their elements, I wrote another snippet of javascript that searches the page for the rows, and hides them. This goes at the end of the HTMLHead panel.

To hide the Availability row:

<script type="text/javascript">
    $(document).ready(function() {
        $("td.CompareFieldName").each(function() {
            if( $(this).text() == 'Availability' ){
            $(this).parent().hide();
            }        
        });
    });
</script>

To remove the Brand row:

<script type="text/javascript">
    $(document).ready(function() {
        $("td.CompareFieldName a").each(function() {
            if( $(this).text() == 'Brand' ){
               $(this).parent().parent().hide();
            }        
        });
    });
</script>

If you need help with customizing any other part of BigCommerce, please reach out, I’m available for hire.

7
October 30, 2011

BigCommerce make “Add to Cart” & “Choose Options” text an image

BigCommerce doesn’t let us touch any of the PHP or HTML that spits out the Add to Cart or Choose Options links. In their support guide, they say to add a background image, but this still means that we need to keep the text, which often times just won’t do. I wrote a quick bit of javascript that goes and finds those Add to Cart and Choose Options instances, and replaces them with an actual image.

<script type="text/javascript">
    $(document).ready(function() {
    	$(".ProductActionAdd a").each(function() {
    		if( $(this).text() == 'Choose Options' ){
    			$(this).html('<img src="/templates/__custom/images/options.png" alt="Choose Options" />');
    		}
    		if( $(this).text() == 'Add To Cart' ){
    			$(this).html('<img src="/templates/_custom/images/add.png" alt="Add to Cart" />');
    		}
    	});
    });
</script>

Hope this helps! If you need further BigCommerce customization (especially with displaying categories the way you want) let me know.

1
June 20, 2011

Mobile Time Tracking using Twilio and Freshbooks

I use Freshbooks to manage all of my invoicing. I manage projects, log hours, and it allows me to keep a careful track of my business. I’m lucky enough to be connect to the internet when I’m working, but for some companies working out in the field, keeping track of hours has been mostly done on pencil and paper.

I built an application integrating Twilio and Freshbooks to solve this problem. Watch the video below to see my Twilio and Freshbooks time tracking system.

How it works

Since you can only submit a completed time log to FreshBooks, the initial clock in call is stored in a database on a separate server. When the user calls back to clock out, it compares the clock out time with the saved clock in time, and then totals up the hours worked. After we know how many hours were worked, the full time log gets submitted to FreshBooks.

Altogether, I mashed up a few different technologies, including:

  • Twilio Voice API
  • Twilio Transcription API
  • FreshBooks API
  • PHP
  • MySQL

If you’re interested in using this for your company, shoot me a message and I’d be happy to set it up for you, or let you license out the code.

4
May 20, 2011

Twilio Syntax Auto-Complete Mode for Coda

I love Twilio‘s markup language, TwiML. It’s intuitive and easy to understand. Still, whenever I’m developing I have to keep the Twilio documentation page open to know all the verbs and attributes of the language. To save time, I created my very own mode plugin for Coda so that as I’m typing, it automatically completes the Twilio commands and shows me all the available attributes. So, without further adue, download Twilio.mode and install it in Coda.

Install instructions:

  1. Download Twilio.mode.zip
  2. Unzip it
  3. Copy the new Twilio.mode folder to: ~/Library/Application Support/Coda/Modes
  4. Reboot Coda, and under Text > Syntax Mode you’ll see Twilio

If you liked this plugin, you should probably follow me on Twitter. I’m always giving away little scripts like this. Note: It’s also available on github.