You are here

protected function SharrreCounterController::getCounterStumbleupon in Share Message 8

Get the counter for Stumbleupon.

Parameters

string $url: Requested URL.

Return value

int Returns the counter for Stumbleupon.

1 call to SharrreCounterController::getCounterStumbleupon()
SharrreCounterController::getCounter in src/Controller/SharrreCounterController.php
Get the counter for Google Plus and Stumbleupon.

File

src/Controller/SharrreCounterController.php, line 80

Class

SharrreCounterController
Route controller class for the Sharrre - Google Plus and Stumbleupon counter.

Namespace

Drupal\sharemessage\Controller

Code

protected function getCounterStumbleupon($url) {
  $content = $this
    ->parse("http://www.stumbleupon.com/services/1.01/badge.getinfo?url={$url}");
  $result = json_decode($content);
  if (isset($result->result->views)) {
    return $result->result->views;
  }
}