Skip to main content

Mobomo webinars-now on demand! | learn more.

I was quoted in today's Launch magazine in Do's and Don'ts of Using Social Internet Sites for Business. In the article, I offer the following advice on adding and interacting with contacts on various social networks:

Don't forget your manners.

While nearly all social networks have rules for participation (don't post obscenities or copyrighted material, for example), the etiquette for adding people to each network is defined by the mores of those on the network, Postman says. He offers a few guidelines:

  • Users should be particularly careful to avoid the appearance of flirtation and inappropriate comments and messages. Use the same rules as you would in the workplace.
  • Don't send blatantly commercial messages. Business networking is OK. Shameless promotion and cold calling is not.
  • If the network allows, give the person you are inviting some context for the invitation.
  • Do not take it badly if someone declines or ignores your invitation to connect. That's their option.
Categories
Author

I'll be participating in Blogout09 in Singapore on March 6, giving my Communications Inside Out (see below) talk, which is based loosely on the last chapter of my book, SocialCorp: Social Media Goes Corporate. I'll be in the esteemed company of Yongfook, the Ashton Kutcher of the Singapore social media scene, and Melvin Yuan, who is referred to by Kevin Lim (aka @brainopera) as "a ridiculously thoughtful public relations gentleman in Singapore."

In commemoration of my visit to Singapore, Kevin has created this stunning photo montage:

Note that Yongfook is cited for his good looks, Melvin for his intelligence, and me for giving away copies of my book. This is how I want to be remembered! On the other hand, can either of them drive a Zamboni? I think not! My picture is a composite and the hand with the book doesn't even belong to me! I appear to be grimacing after eating a bug or something.

Here are a few things you might not know about me:

  • I came up with the original concept for Blogout in 1992, but since there was no such thing as blogging then, I had a hard time selling the idea
  • The internet IS a series of tubes, and I will prove this scientifically during my presentation
  • If you send me $500 by PayPal, I will disclose my great secret of making millions by blogging.

Hope to see you in Singapore!

Communications Inside Out

Now that the social media "dust" has settled, many companies feel like they've made the transition to a stable, predictable, Web 2.0 world. Not so fast! I'm going to lead a conversation about a second wave of changes underway or rapidly approaching. Communications Inside Out, based on the final chapter of my book, is loosely structured around five key shifts in perceptions about what social media is, and how it behaves:

  • Speed-->Brevity
  • Managed Participation-->Chaos
  • Letting Go-->Taking Back
  • Engagement-->Doing Business
  • Wild Wild West-->Civilized World

For example, the attention span of the average person online has grown shorter and shorter, and with it, the length and duration of online content has similarly been reduced. Online videos, once considered "short" at three minutes, are now less than a minute, or even a few seconds in length. Entire "blog posts" have been reduced to 140 characters on sites like Twitter. In other words, while the emphasis in social media was on speed, it is now on brevity. Similar shifts have taken place elsewhere. My presentation will take a random walk through a handful of such shifts, helping participants better understand the nature and role of social media in the future.

Categories
Author

PayPal is an easy-to-use tool for making payments and ActiveMerchant is a great Ruby library for payment processing. A lot of us already have PayPal accounts for eBay and it works great in auctions, where you pay just once. However, ActiveMerchant currently does not support recurring billing through PayPal.

One requirement of a recent project was to charge for a monthly or yearly subscription plan, via PayPal. Therefore, I did some Googling and found that Jon Baker has already extended ActiveMerchant to add this functionality using PayPal’s Name-Value Pair (NVP) API. However, as Cody Fauser pointed out, the NVP API was taken out from ActiveMerchant, so I had to implement that with PayPal’s SOAP API.

First, download this file and put it in vendor/plugins/active_merchant/lib/active_merchant/billing/gateways/. Use the GitHub from now because maintaining a separate file download is too troublesome. Alternatively, there’s a fork on GitHub at http://github.com/rayvinly/active_merchant/.

In your controller, after a user selects one of your subscription plan, the form goes to the checkout action:

   def checkout     response = gateway.setup_agreement(:description => description, :return_url => return_url, :cancel_return_url => cancel_return_url)     redirect_to gateway.redirect_url_for(response.token)   end

This redirects the user to PayPal so he can login and read the description you provided. After he confirms, he is redirected back to your application’s return_url, which I set it to be the complete action below. If he cancels, he is redirected back to the cancel_return_url. You can set cancel_return_url to be the plan selection page where he can choose a different plan.

If he confirms, here’s the complete action:

   def complete     token = params[:token]     response = gateway.create_profile(token, :description => description, :start_date => start_date, :frequency => frequency_in_months, :amount => amount_in_dollars, :auto_bill_outstanding => true)   end      # Save this profile_id in your transactions table.  This is used to cancel/modify the plan in the future.     profile_id = response.params["profile_id"]      if response.success?       flash[:notice] = "Your PayPal account was successfully set up for the <strong>#{description}</strong> payment plan."       redirect_to login_path     else       flash.now[:notice] = "There was a problem setting up your PayPal account for the <strong>#{description}</strong> payment plan"       render cancel_url     end   end

I default the frequency to be in months and turn on auto_bill_outstanding because that is what I need, but you can look at the file you downloaded and the PayPal documentation to see what other options are available.

If the user wants to cancel the payment plan, a cancel action would look like:

   def cancel     response = gateway.cancel_profile(paypal_profile_id, :note => 'Payment plan was canceled by user')     flash[:notice] = 'You have successfully canceled your membership'   end

paypal_profile_id is the profile_id you saved in the complete action from above. Keeping this profile_id is very handy.

That’s it. Enjoy making money!

Categories
Author

After doing a quick Google Search I realized that everyone might not know about a great way to do URL validation in Rails. The secret is a little-known method of the URI class, regexp. It lets you generate a regular expression for matching URLs based on an array of accepted protocols. What’s even better, it can be plugged directly into Rails’s validates_format_of. It’s this easy:

class User   validates_format_of :website, :with => URI::regexp(%w(http https)) end

This will match anything that URI.parse will recognize, meaning that it’s a pretty accurate and powerful URL matcher. URL validation was one of those little annoyances in writing Rails models because it really seemed like there should be an easier way. I found mine, so I thought I’d share it!

Categories
Author

Here's why, in no particular order, we think the Extensible Messaging and Presence Protocol (XMPP) will rock your world soon:

  • Real-time web applications are in high demand, and XMPP fits the requirements perfectly -- it excels in rapid peer-to-peer or broadcast messaging.
  • Response times are crucial for the new breed of web applications, and polling-based solutions are very suboptimal. Enter XMPP and BOSH.
  • The maturing of the BOSH protocol, coupled with the resurgence of excellent Javascript libraries have, IMHO, opened up extremely cool new worlds via the browser. Strophe, in itself, is a treasure.
  • XMPP servers, which are essentially make or break an XMPP application, are rapidly maturing beyond instant messaging. Especially eJabberd.
  • It's possible to deploy a custom eJabberd module based on the XMPP protocol but tailored specifically for your application in a matter of hours. The initial learning curve is offset by the rapid development speed of the Erlang language (thanks to its immutability) afterwards.
  • While there's a lot of focus on developing pure web applications, as of now nobody has figured out a great way to make money off the Instant Messaging protocol. This will be a boon for XMPP development very soon as new startups try to tap into that market.
  • The web framework wars are slowly winding down, and in the end developers are left with the classic problems -- many will now be turning to alternative tech for the problems that most web frameworks don't even attempt to solve; XMPP is the solution for many of these problems.
  • The community, albeit small, is growing and passionate. Extremely passionate. Search for XMPP on Twitter. The mailing lists are very active as well.

Apart from all of these, as a developer I find writing XMPP applications to be a very engaging and enjoyable activity. Word will spread, and there will be new converts. At Intridea, we've been actively developing and integrating XMPP into our products, and we will be leveraging it on a case-by-case basis for our client work. You'll be hearing more about that shortly.

Categories
Author

I was working on a project where I needed to send out a daily digest email.  The emails needed to be sent out on a scheduled interval, not as the result of some user action.  This meant that it would need to be handled outside of the normal request/response cycle.

Typically in the Rails world, when someone mentions long-running, or background tasks, you think either BackgrounDrb or Starling/Workling.  Those tools are fine and all -- actually, don't get me started on BackgrounDrb -- but I wanted something a bit more simple.

I didn't need queueing, or jobs, or anything like that.  I had only one task to manage.  I just want something that will say, "Once a day, do [task]", and that's all.

Also, I really didn't want to have to monkey with deployment tasks, be it with Vlad or Capistrano or whatever.  I wanted to just deploy as usual, and have it all just work, no extra processes to start or tasks to run.

This seemed like a tall order, but I began my search anyway.  Google led me to a number of pages about a number of tools, all of which included one or more of the things I was trying to avoid.

Despite having only a one line mention near the bottom of the page, I decided to check out rufus-scheduler, and it turned out to be exactly what I was looking for.  There was no database table, queueing mechanism, or separate process to manage.  Just a simple scheduler to call out to your existing ruby code.

It couldn't get any simpler.  Here's how I set it up...

First, install the gem.

sudo gem install rufus-scheduler

I also froze it into vendor/gems by declaring the gem in the initializer block of environment.rb and then running rake gems:unpack.

Then I created a file called task_scheduler.rb in my config/initializers directory.   Inside this file is where the magic happens.  This is where it all goes down.  Are you ready?  Here it is...

scheduler = Rufus::Scheduler.start_new    scheduler.every("1m") do     DailyDigest.send_digest!  end

Yeah, that's it. Seriously.

I was in disbelief myself until I started up the server and watched it send me an email.  In it's current state, it would send the digest every minute, which is not what I wanted.  Fortunately, the rufus-scheduler provides several ways to schedule your tasks.  Once I was ready, I changed it to more of a cron-style scheduler.

scheduler = Rufus::Scheduler.start_new    # Send the digest every day at noon  scheduler.cron("0 12 * * *") do     DailyDigest.new.send_digest!  end

You could also use scheduler.in or scheduler.at for one time tasks set to run at some point in the future.

So there you have it.  Dead simple task scheduling in Rails.  It really doesn't get any easier.

Categories
Author

Today came the announcement that all of the major search engines are going to support a ‘canonical’ URL hint that will allow site owners to specify a single URL for content that may be replicated across many URLs (such as for categories etc.).

To make use of this in Rails applications, I’ve written a plugin that allows you to easily specify canonical URLs for your content. To install it as a gem, just add this to your environment.rb:

config.gem 'mbleigh-canonical-url', :source => 'http://gems.github.com', :lib => 'canonical_url'

Using it is extremely simple; just add this to the <head> section of your layout:

<%= canonical_link_tag %>

And in your controllers, any time you want to specify a canonical URL you can do so like this:

class BlogController < ApplicationController   def show     @post = find_post # assume this is a standard blog post type record     canonical_url blog_post_path(post.year, post.month, post.day, post.slug)   end end

Now any time the show action is run, no matter how the routing came to be there, a single canonical URL will be shown in the header. If no canonical URL is specified in the controller (or through the canonical_link_tag helper directly) the helper will not output anything, making it completely harmless to add to any application.

The source for the plugin is available on GitHub. So go forth and canonize your applications!

Categories
Author

A few days ago, Chris asked on our Intridea instance of Present.ly if anyone knew how to ask git how much code was written by a certain author. This kind of request came up fairly regularly at my previous job, and as far as I know, there isn't a built-in git command for it, so I took a few minutes and came up with something.

First of all, "git log --numstat" will give us output like this

Which is very strongly patterned. When I see strongly patterned output in the console, the first thing I think of is awk. Write ups for awk abound (my personal favorite is here) but the basics are simple: you define a series of [pattern, action] pairs. When the awk script is run, each line of input is compared to the patterns in turn, and when a pattern matches, the associated action is executed.

Let's look at the evolution of this "score authorship" script as an example. Save this as "git_score.awk" and then (from inside a git repo) run "git log --numstat | awk -f /path/to/git_score.awk"

Patterns are delimited by forward slashes, and actions are surrounded by curly braces. The special pattern END matches once the end of input has been reached. The pattern /Author:/ matches the lines beginning with "Author:", and the variable $2 is automatically set by awk to the second word on that line. Arrays in awk can be autovivified (they spring into existence when referenced), and they default to zero. Also, awk, like PHP, uses associative arrays throughout (in ruby/perl parlance, hashes and arrays are the same type). Running the above file should give you a listing of authors who contributed to the repo and a count of the number of commits that author made.

Convinced that this would work, I continued:

Now we count changes by adding a pattern to match any lines that begin with a digit.

Lines like the above, which correlate to lines inserted, lines deleted, path/to/file/changed. We save those to a running tally of changes per author by using two more autovivicated arrays, printing the totals when we finish.

At this point, Chris mentioned that he'd like to ignore counting contributions to files in the framework directory. That's accomplished easily enough, and while we're at it, let's count files as well as insertions/deletions.

It's important that the exclusion pattern come BEFORE the inclusion pattern. The "next" action will skip matching any further patterns and immediately start over on the next line of input. If we wanted to also skip files in vendor, we could make the pattern

One more problem: Chris asked for percentages, and at this point we're outputting counts. This may not be the neatest way to convert between the two, but it is an easy one (unless you have an author named "tot"!)

I showed this to Chris (elapsed time ~30 minutes). He was satisfied, but Simon jokingly asked for a more machine-friendly output (CSV or YAML). I considered switching to ruby (the .to_yaml method was tempting) but decided that it wasn't necessary yet, since YAML is such a simple markup.

There you have it. Authorship percentages for a git repository. Just save the above to a file and run it as "git log --numstat | awk -f /path/to/the/file/you/just/saved". Or create an alias in your .shell_rc file.

Categories
Tags
Author

Rich media, which includes audio, still images, flash animations and video, is becoming increasingly popular in online communications, for everything from marketing and public relations, investor relations, to employee communications and training. Users consider video the most credible form of online content, ahead of both audio- and text-based content. In a survey conducted in 2007, nearly 60% of B2B buyers said video influenced their purchase decision.

Video in particular is at the root of what can only be called a revolution. Capabilities that less than 10 years ago might have cost a company $100,000, can now be obtained for less than a tenth of that. Video production and posting to your web site is now so simple and inexpensive that there is no excuse not to use it.

Video is the most engaging form of online content. People who spend time online are often reluctant to read long articles, white papers or blog posts. They want their information in quick bites. Short videos (3 minutes maximum except for highly technical or specialized material) are ideal. Video also has high social/pass around value. People are more likely to bookmark/share a video, and to comment on it, than they are with an article or blog post.

If you don't already have an onsite recording studio, you should build one. It's relatively easy and inexpensive, and will get your company into the 21st century. Set aside a small conference room, do some soundproofing and you've got a studio. For equipment, you'll need a fast, current laptop, a handicam with USB and/or Firewire, two high quality microphones, a mixer, some cables and software for capturing and editing video. The same studio can also be used for audio recording and production. Don't scrimp on the microphones. Good video is simple. Good audio is an achievement.

You'll also need a place to upload/host videos, and a media player. Feedroom is just one of many companies that host video. For internal use, you might be able to host on your own servers. There are public, free video players which are generally (not always) supported with contextual advertising. Some of these can be customized with your logo, etc. There are also dedicated enterprise players (like Intridea's MediaPlug)that allow more security and control, and the ability to customize with company colors and brand identity.

Some very affordable video software suggestions: Final Cut, AVID, or Adobe Premiere. And for audio only: Garage Band and Cubase. (Note: Some are Apple OSX or Windows only, but most work on both platforms.)

In addition to technological and production considerations, and more important, is a video content strategy, which like anything you do in social media/social business, should tie to your broader business and communications objectives. Think about what your key messages are, what you're trying to accomplish, and what topics and company events might best be supported with video content. Not every video should be done by the CEO. Think about the most qualified, articulate spokespeople in your company and whether they should be the ones in front of the camera.

Some ideas for using video:

  • Quarterly earnings report (both public web site version and version for employees)
  • Leadership and motivational videos
  • How-to's, chalk talks
  • Interviews with clients/customers
  • Customer support
  • Product launches
  • Live broadcasts and archives of executive speeches and company events

The topic of online video is obviously too complex to cover in the space of a blog post, but hopefully this gives you a sense of the benefits of joining the video revolution and how to get started.
If there's anything you'd like me to comment on in the next Intridea newsletter, or to write about here on the blog, please let me know!

Categories
Tags
Author

Twitterland is chirping with this morning's news that Twitter has announced its intention to start charging commercial users of the service. If anything good comes to Web 2.0 out of the economic downturn it's the realization that the free (don't get me started on free) business model is not sustainable and actually hurts users.

The report appeared in a piece by Fiona Ramsay in Twitter to Begin Charging Brands for Commercial Use* in Marketing Magazine (UK), in which Twitter co-founder Biz Stone said, We can identify ways to make this experience even more valuable and charge for commercial accounts. Stone did not elaborate on what those ways are, or what kind of charges might be assessed. He also gave his assurance that individuals would not be charged for Twitter.

Why It's Good News

The announcement is great news. First, Twitter could use the revenue to build more reliable IT infrastructure. Service interruptions, unpredictable availability of features and spotty performance are chronic Twitter problems. The monthly service charges probably wouldn't fund a new data center, but the validation that Twitter can make money would increase its valuation and attract more investment. Ultimately, a commercial model will bring new reliability and new functionality to all users.

The other important outcome of this was touched on by Chris Anderson in The Economics of Giving it Away in the February 2 Wall Street Journal:

Free is not enough. It also has to be matched with Paid ¦ today's Web entrepreneurs have to not just invent products that people love, but also those that they will pay for. Not all of the people or even most of them -- free is still great marketing and bits are still too cheap to meter -- but enough to pay the bills. Free may be the best price, but it can't be the only one.

By making the move to at least a partially commercial model, Twitter is sending a signal that the service has worth (and costs). Not everything in the online world wants to be free, nor can it be.

I know it sounds like I am arguing against my own best interests when I advocate the transition from free to paid for the services and content I use. But when I consider the alternative, a world in which everything is paid for with spam, contextual crap advertising, and phony informational content that is not so subtly marketing a product or service, I am glad to pay for a few choice things.

What Is a Twitter Account Worth to a Large Business?

Along with HTML and the web browser, e-mail, and instant messaging, I doubt there is anything that has changed the way people use the Internet, and the way they communicate, more than Twitter has. But just what is Twitter worth to a business? Twitter hasn't made any such announcement, but let's assume that commercial users are companies over a certain size, say, 100 people. (I would hate to see my good friends at House of Jerky or Etsy craft people charged to use Twitter, for example. That would certainly drive them off the site.) How much does a large corporation pay to keep up its web site home page, and what are the comparable benefits of using Twitter?

I have no idea what Twitter is thinking about this, but $20 a month or even $100 seems like nothing to GM (no bailout joke intended here), Dell or Comcast. And speaking of Dell, according to the Marketing piece Bob Pearson, vice-president of communities and conversations at Dell, said: 'If it becomes complicated and costly, our instinct would be to move elsewhere.' Where Bob, Plurk? Pownce? If you're a consumer business and you find benefit to being on Twitter, there is no elsewhere.

This raises a number of questions. Is the move is a good thing for individual users? For businesses? What criteria should be used in identifying commercial Twitter use? Would the term apply to anyone selling a product or service? How much should Twitter charge for commercial use?

* Why do marketers refer to corporate entities as brands? They're businesses, not brands, in this instance. Stop the industry doublespeak madness!

Categories
Author
Subscribe to