heiseonline / shariff-backend-perl

Perl (Mojolicious) backend for Shariff. Shariff enables website users to share their favorite content without compromising their privacy.

Home Page:http://ct.de/-2467514

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[OBSOLETE] 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}

About

Perl (Mojolicious) backend for Shariff. Shariff enables website users to share their favorite content without compromising their privacy.

http://ct.de/-2467514


Languages

Language:Perl 100.0%