Development
Social Image example in Salesforce

Social influence Score as an Image (using Klout)

Social Image example in SalesforceI originally presented this in a session at Dreamforce 2012. Its a little application to allow you to view a users/customers social influence as an image based on their twitter handle/address. It uses Klout a social influence system and Klout scores are marked out of 100. The higher the score the more influential the person is.

My example showed how you could add the feature using a simple formula field in Salesforce, but at the end of the day its an image so can be added to more or less anything.

I used it to demonstrate how easy it is to show a customers social influence within Salesforce using just a simple formula field and how you could use their social score to rank support calls or identify who your most influential customers are for marketing etc.

To use it all you have to do is pass a couple of parameters into a url and the image will be returned eg:

Social Influence score

The URL is made up of the following parameters:

  • NetworkScreenName; The twitter handle/name you want the score for, so in my case this is: radnip
  • NetworkPlatform; The platform you want to use at the moment it only supports Twitter but the Klout API does support other networks including LinkedIn etc but at the time of writing it only supports twitter so this should be: twitter
  • KloutAPIId; This is your Klout API key which you can get from the Klout website at developer.klout.com its free to register. But please note that your key will be potentially visible in the URL, for an internal CRM solution like Salesforce this usually is low risk but please be aware of the implications if someone else uses your Key!
  • (optional) monthChange; This allows you to see how the score has changed over the past month (eg: Social Influence with month change shows that the score has increased by 0.073 over the past month). Set this to equal 1 if you want to see the month change.

So your link should look something like this with the month Change:

http://socialimage.herokuapp.com/getImage.php?NetworkScreenName=radnip&NetworkPlatform=twitter&KloutAPIId=3abgffbxzyg7sufuvpjqajs8&monthChange=1

or without the month change:

http://socialimage.herokuapp.com/getImage.php?NetworkScreenName=radnip&NetworkPlatform=twitter&KloutAPIId=3abgffbxzyg7sufuvpjqajs8

(WARNING: Do not copy the API key in the URL its just an example, it may look like it works but its an incorrect API key!).

The Social Image application runs on Heroku which is a massively scalable development platform. The scores are cached for up to 24hrs so if you see a slightly different score to Klout thats why, but if they are different they are usually only one point out. The reason its cached is so that the app doesn’t hammer the Klout APIs.

Using SocialImage in Salesforce:
To use the social Image in Salesforce you need to have two fields in Salesforce. One holding the twitter handle and the other as a formula field to hold the score. For example you could add the field on Salesforce Cases or Contact records, both work in the same way:

First create a field to store the twitter handle (in my case I called it ‘Twitter’ so the API name is ‘Twitter__c’, next create a TEXT formula field and add the following:


IMAGE('http://socialimage.herokuapp.com/getImage.php?NetworkScreenName='+Twitter__c+'&NetworkPlatform=twitter&KloutAPIId=3abgffbxzyg7sufuvpjqajs8', '')

Again as above change the KloutAPIId to your API Id. You can then add the field to list views or reports. As the score is an image you won’t be able to order the column by the score as its an image. If you want better functionality check out the Salesforce Kred appExchange application.

That’s it, any questions please let me know!

  • Social Image example in Salesforce
    Development

    Social influence Score as an Image (using Klout)

    I originally presented this in a session at Dreamforce 2012. Its a little application to allow you to view a users/customers ...
  • Salesforce Partners
    General

    How to find a Salesforce Partner

    I’m just sitting at San Francisco airport reminiscing on Dreamforce this year. I was thinking of all the questions myself and fellow MVPs have been ...
  • Administration Development News

    My Dreamforce 2012 Sessions

    This years Dreamforce is shaping up to being brilliant! Richard Branson, Colin Powell and Jeff Immelt all talking at the event ...
Load More Related Articles
Load More By Francis Pindar
Load More In Development

Check Also

Time for a tech implant?

A couple of weeks ago I was at ...

Subscribe via Email

Enter your email address to subscribe and receive notifications of new posts by email.

Upcoming Events

Follow me on Twitter

Currently reading

From Goodreads

  • Book cover

    The Hitch Hiker's Guide to the Galaxy: A Trilogy in Five Parts

    Douglas Adams

  • Book cover

    The Warren Buffett Way: Investment Strategies of the World's Greatest Investor

    Robert G. Hagstrom