Perl (Mojolicious) backend for Shariff. Shariff enables website users to share their favorite content without compromising their privacy.
Perl Perl6
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/Heise
log init Nov 12, 2014
script init Nov 12, 2014
t update to current Mojolicious, cleanup Feb 8, 2016
.gitignore
.perltidyrc
.travis.yml
Changes make facebook counter extraction more robust May 31, 2016
Makefile.PL
README.md
heise-shariff.conf use authenticated graph api if available Mar 19, 2015

README.md

Shariff Perl Backend Build Status

Shariff is used to determine how often a page is shared in social media, but without generating requests from the displaying page to the social sites.

Shariff Logo © 2014 Heise Zeitschriften Verlag

This document describes the Perl backend. The following backends are also available:

Installing the Shariff backend on you own server

This software is based on Mojolicious. Make sure, you've installed it, e.g. by running cpanm Mojolicious.

To get started with the shariff backend, unzip the current release zip file into a local folder. Start the server application by using the hypnotoad script.

$ hypnotoad script/shariff
Server available at http://127.0.0.1:8080.

You need to proxy requests from your webserver to the hypnotoad server. See Mojolicious Cookbook for some Nginx or Apache recipes.

This project is bundled with a configuration file shariff.conf. The following configuration options are available:

Key Type Description
cache hashref Cache settings described below
domain regexp A regular expression describing one or more domain(s) for which share counts may be requested
hypnotoad hashref Hypnotoad webserver settings as described in Mojolicious docs. You may want to change the listen setting.
services hashref Service specific settings

Cache settings:

Key Type Description Default
class scalar Cache class name to use. Heise::Shariff::Cache.
expires scalar Time in seconds to hold fetched data in in-memory cache. 60
options arrayref A list of options to be passed to the cache class constructor. Setting options to [{foo => 'bar'}, 'baz'] leads to call $cache->new({foo => 'bar'}, 'baz'). []

Testing your installation

If the backend runs under http://example.com/my-shariff-backend/, calling the URL http://example.com/my-shariff-backend/?url=http%3A%2F%2Fwww.example.com should return a JSON structure with numbers in it, e.g.:

{"facebook":1452,"googleplus":23}