Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

headissue/shariff-backend-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OBSOLETE

OBSOLETE this repo has not been maintained in a while. Please try https://github.com/shred/shariff-backend-java as an alternative

shariff-backend-java Build Status

A java backend for https://github.com/heiseonline/shariff

Deploy

Deploy

To use your own server, simply build the app (mvn package) and deploy the resulting war to your favourite application server.

Test locally

mvn tomcat7:run

Should result in 'Running war on http://localhost:8080'

Open http://localhost:8080/?url=www.example.com to receive

{"reddit":25,"facebook":474517,"twitter":10237,"linkedin":0,"delicious":0,"stumbleupon":5882,"pinterest":1,"google-plus":28387}

Configuration

see Config Class

Configure the proxy via environment variables:

# here you should provide a way to contact you. this information will be sent with the 
# user-agent header
SHARECOUNT_PROXY_MAINTAINER=my.domain.com
# restrict for which domains one can request the sharecounts for
# a semicolon delimited list of domains, regular expressions are possible
SHARECOUNT_PROXY_DOMAINLIST=.*
# sharecount uses cache2k, these are the things you can configure
SHARECOUNT_CACHE_SIZE=1000
SHARECOUNT_CACHE_EXPIRY_MS=300000

Roadmap

  • restrict length of parameter

suggestions and feedback welcome