socol

command module
v0.0.0-...-86b44d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

README

socol

Social metrics collector written in Go.

Build Status Go Report Card ImageLayers Docker Pulls Docker Stars

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

Running 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).

Deploy

Platforms

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

Why is Twitter not supported? Twitter has decided to remove stats from their public interfaces. You can read more about why on their blog.

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL