I’ve been working on features for this website lately, one of which has been figuring out silly social sharing links. I’ve had a website long enough to remember the days of building a comment system in Perl, having a hit counter, and that being good enough.
Now you need to have all sorts of crap on a page in order to make sharing as easy as possible. One option is to piecemeal all the different networks together, but that requires giving up some control of your aesthetic, which I am not a fan of.
Or you use a plugin like AddThis, which makes all that easier, maintains some control of your aesthetic, and also allows the people on your site a comical number of options for sharing.
Personally, I don’t like either of these, which left me to write my own. Here’s the problem:
TMI
As a user, how does knowing the breakdown of how many shares your content had on each social network influence me about your content, or where I should share it? If it’s blowing up on Facebook but not on Twitter, should I be more compelled to Tweet about it, or post it on Facebook?
You shouldn’t really care. The thing you’re trying to communicate is: “Hey! This is popular! People are sharing this!” Or if nobody has shared it: “You can share this if you want” and then making that process easy.
If that person only uses Facebook, they’re not going to sign up for Twitter just because that post got more retweets than likes, so why all this extra information?
Things are scattered
Some of my content has been scattered around posted in various places, and it all doesn’t come back nicely to one URL. If I write a new song, I’ll post the soundcloud song URL to Facebook and Reddit, and then I might write about it a bit on here. The Facebook link wasn’t pointing back to here, so any sort of share button I put on the blog post isn’t going to indicate how many shares that song got. Because things are scattered now.
Everything’s getting siloed off, and everybody wants to have a platform for content with their own ranking system. Meanwhile, I’m trying to reel everything back under one roof and consolidate things. More on that later.
Step One
Step one in implementing a consistent indication of popularity on this here website was to write something to go out and fetch social metrics for multiple URLs. That part is done. I wrote a Ruby Gem (aptly named Popularity). Given a url (or multiple urls) it goes out and fetches the social metrics across the major networks, and gives you the total number.
1
2
3
4
5
6
7
8
9
10
11
search = Popularity.search(
"http://jeffkeen.me/p/I-know-its-you/",
"http://soundcloud.com/jeffkeen/i-know-its-you")
search.facebook.shares #=> 38
search.twitter.tweets #=> 0
search.pinterest.pins #=> 0
search.reddit.posts #=> 1
search.reddit.comments #=> 34
search.reddit.score #=> 626
search.soundcloud.plays #=> 14732
search.total #=> 15407
It was pretty fun to write, and I’d like to add some more features to it. But not before I do the next step of actually hooking it up to this here web site.