Motivation
Nothing fancy, just wanted to have simple and neat API to get all the statistics I want. I'm also kinda pedantic and wanted to style social buttons whatever I like in an easy way. I hope that this app will be also simple for you and you'll enjoy using it.
Btw, this application is proudly written in Go language. It turned out to be a translated version of similar webservice I wrote in Ruby. However, unlike the Ruby ones this is fully parallel and at the end aprox. 10 times faster than original one (benchmarks don't lie). Check out my blog post to get more details.
Usage
Egoistat provides public API which can be queried in two ways. You can perform standard HTTP query to get social networks' points in JSON format:
$ curl -H 'Accept: application/json' http://egoistat.com/api/v1/stat.json?url=PAGE_URL&n=NETWORKS
PAGE_URL
must be full URL with
scheme specified, eg. http://egoistat.net
.
NETWORKS
gets comma separated
list of social networks to get points from. Currently available
networks are: facebook
, twitter
,
plusone
, reddit
, hackernews
and github
.
You can also request a script ready to use on your website, so that no backend calls will be required:
<script src="//egoistat.com/api/v1/stat.js?url=PAGE_URL&n=NETWORKS&cb=CALLBACK"></script>
This script defines the egoistat
global variable -
it responds to points(sn)
function
which return points count for specified social network sn
.
It is also possible to specify CALLBACK
which is going to be
executed after script gets loaded.