Public Repository

Last pushed: a year ago
Short Description
Social metrics collector microservice.
Full Description

socol

Social metrics collector written in Go.

Install

go get github.com/otobrglez/socol

Usage

Collect stats for one URL.

socol -url https://golang.org/

Collect stats for multiple URLs and selected platforms.

socol -url https://golang.org/,http://www.scala-lang.org/ -platform facebook,linkedin

Runing as server

Start it on port 6000.

socol -s -p 6000

# Try it,...
curl "http://127.0.0.1:6000/stats?url=https://golang.org/"

This app is ready to be used with Heroku or Docker (instructions).

Platforms

socol supported collection of following metrics: Bufferapp, Facebook,
Google Plus, Linkedin, Pinterest, Pocket, Reddit, StumbleUpon, Tumblr.

Docker

Running socol server via Docker.

docker run -ti -p 5000:5000 otobrglez/socol

curl -s <docker_host>:5000/stats\?url=http://www.facebook.com | python -mjson.tool

Response from service.

{
    "facebook": {
        "click_count": 0,
        "comment_count": 7837699.0,
        "commentsbox_count": 5177,
        "completed_in": 0.28217279100000003,
        "count": 57893662.0,
        "fetched_in": 0.282076959,
        "like_count": 20070293.0,
        "share_count": 29985670.0,
        "total_count": 57893662.0
    },
    "google_plus": {
        "completed_in": 0.31490062700000004,
        "count": 338527,
        "fetched_in": 0.269049992
    },
    "linkedin": {
        "completed_in": 0.78390614,
        "count": 4479,
        "fetched_in": 0.783683243
    },
    "meta": {
        "total": 58320895
    },
    "origin": {
        "Locale": "sl_SI",
        "SiteName": "Facebook",
        "URL": "https://www.facebook.com/",
        "completed_in": 0.343662642,
        "fetched_in": 0.33344814500000003
    },
    "pinterest": {
        "completed_in": 0.143030286,
        "count": 60256,
        "fetched_in": 0.142972456
    },
    "stumbleupon": {
        "completed_in": 0.435604561,
        "count": 23971,
        "fetched_in": 0.435491601
    }
}

Author

License

Use it under MIT.

Docker Pull Command
Owner
otobrglez

Comments (0)