All Projects → evansims → Socialworth

evansims / Socialworth

Licence: mit
A PHP library for determining the popularity of a URL across social networks.

Projects that are alternatives of or similar to Socialworth

Facebookclientplugin
Facebook Client Plugin for Xamarin iOS and Android
Stars: ✭ 89 (-25.21%)
Mutual labels:  social-network
Esteem Surfer
Ecency desktop formerly known as Esteem Surfer - reimagined desktop social wallet, contribute and get rewarded (for Windows, Mac, Linux)
Stars: ✭ 100 (-15.97%)
Mutual labels:  social-network
Firstcoursenetworkscience
Tutorials, datasets, and other material associated with textbook "A First Course in Network Science" by Menczer, Fortunato & Davis
Stars: ✭ 111 (-6.72%)
Mutual labels:  social-network
Tradenomiitti
A web app written in Elm
Stars: ✭ 90 (-24.37%)
Mutual labels:  social-network
Friendica Addons
Addons for Friendica
Stars: ✭ 94 (-21.01%)
Mutual labels:  social-network
Socialnetwork
Laravel and Vue.JS powerd social network
Stars: ✭ 101 (-15.13%)
Mutual labels:  social-network
Everest Ios
iOS Client for Everest.com
Stars: ✭ 85 (-28.57%)
Mutual labels:  social-network
Materialabout
It's a material-design about screen to use on your Android apps. A developer profile and application information easy to integrate. 🔖
Stars: ✭ 1,511 (+1169.75%)
Mutual labels:  social-network
Microstatus
Lightweight Mastodon- and GNU social-compatible ActivityPub and OStatus server implementation
Stars: ✭ 96 (-19.33%)
Mutual labels:  social-network
Mixedfeed
A PHP library to rule social-feeds, to entangle them with magic, a PHP library to gather them and bind them in darkness
Stars: ✭ 105 (-11.76%)
Mutual labels:  social-network
Doesangue Core
Online platform that connects people interested in blood donation
Stars: ✭ 91 (-23.53%)
Mutual labels:  social-network
App
free software application for social network analysis and visualization
Stars: ✭ 94 (-21.01%)
Mutual labels:  social-network
Nakama
The next social network for anime fans 🚧
Stars: ✭ 105 (-11.76%)
Mutual labels:  social-network
Easylogin
Login effortlessly with different social networks like Facebook, Twitter or Google Plus
Stars: ✭ 90 (-24.37%)
Mutual labels:  social-network
Laravel Social Network
Laravel 5.4 - location-based social network
Stars: ✭ 114 (-4.2%)
Mutual labels:  social-network
Svelte Social Auth
Social Auth for Svelte v3
Stars: ✭ 86 (-27.73%)
Mutual labels:  social-network
Dandelion
a diaspora* client for Android
Stars: ✭ 100 (-15.97%)
Mutual labels:  social-network
Airesis
The Social Network for eDemocracy
Stars: ✭ 116 (-2.52%)
Mutual labels:  social-network
Hify
Social network powered by firebase
Stars: ✭ 115 (-3.36%)
Mutual labels:  social-network
Onebody
private member portal for churches, built with Ruby on Rails
Stars: ✭ 1,408 (+1083.19%)
Mutual labels:  social-network

Socialworth

Latest Stable Version Build Status Coverage Status License

A simple PHP library for determining the popularity of a given URL by querying social network APIs.

It presently supports:

  • Twitter (counts mentions and retweets)
  • Facebook (counts likes, comments and shares)
  • Google+ (+1s)
  • Pinterest (shares)
  • Reddit (counts submitted stories and upvotes)
  • StumbleUpon views
  • LinkedIn shares
  • Hacker News API service is currently offline.
  • Mozscape Backlinks Retired.

There a variety of use cases for this library; generating a list of your blog's most popular articles for optimizing placement, or featuring social network counters on your pages without relying on bloated external JavaScript includes.

Installation

To add this package as a dependency for your project, simply add evansims/socialworth to your project's composer.json file. Here is an example of a minimal composer.json file:

{
    "require": {
        "evansims/socialworth": "*"
    }
}

Then run composer install to install the library. Composer generates a vendor/autoload.php file that you'll need to include in your project before invoking Socialworth:

require 'vendor/autoload.php';

Usage

To query all supported services for a URL:

<?php
use Evansims\Socialworth;

$socialworth = new Socialworth('https://github.com/');
var_dump($socialworth->all());
?>

Alternatively you can query just one service:

<?php
use Evansims\Socialworth;

var_dump(Socialworth::twitter('https://github.com/'));
?>

Or leave out specific services from your query:

<?php
use Evansims\Socialworth;

$socialworth = new Socialworth('https://github.com/');
$socialworth->linkedin = false;

var_dump($socialworth->all());
?>

The all() method will return an object that you can use to grab individual service results or find the combined popularity from the services:

<?php
use Evansims\Socialworth;

$socialworth = new Socialworth('https://github.com/');
$response = $socialworth->all();

var_dump($response->total); // Total likes, shares, upvotes, etc.
var_dump($response->reddit); // Just shares and upvotes from reddit.
var_dump($response->twitter); // Just mentions, retweets and shares on Twitter.
?>

Demo Script

A demo script is provided that allows you to query the library from your browser, or the command line.

To call the script from the command line ...

$ php demo.php https://github.com/

Or, to query individual services ...

$ php demo.php --twitter --facebook https://github.com/

If the demo script is accessible from your web server, you can pass a url ...

http://localhost/path/to/demo.php?url=https://github.com/

Whether from the CLI or the browser, you will receive a JSON object back.

{
    "total": 48217,
    "twitter": 26582,
    "facebook": 15284,
    "pinterest": 157,
    "reddit": 5,
    "googleplus": 6049,
    "stumbleupon": 297,
    "linkedin": 0
}

This work was inspired by Jonathan Moore's gist: https://gist.github.com/2640302

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].