Navigation Menu

Skip to content

ArthurHoaro/shaarli-api

 
 

Repository files navigation

Shaarli REST API

Installation

Requirements

  • PHP 5.4.4
  • MySQL or Sqlite
  • PDO
  • Apache RewriteEngine
  • PHP PECL fileinfo for favicons fetching (optional)

Update your installation

  • Update your installation via Git (git update origin master) or the archive file.
  • Check if there was any changes in config file, and add settings if necessary.
  • Update external libraries with Composer. Run: composer update.
  • Run cron the finalize the update: php cron.php.

Install via SSH exemple (debian)

cd /var/www
# Clone repo
git clone https://github.com/mknexen/shaarli-api.git
# Create mysql database
mysqladmin create shaarli-api -p
cd shaarli-api
# Copy `config.php.dist` into `config.php` and setup your own settings.
cp config.php.dist config.php
nano config.php
# Run composer install
php -r "readfile('https://getcomposer.org/installer');" | php
php composer.phar install
# Run cron
php cron.php

API Usage

  • /feeds La liste des shaarlis
  • /latest Les derniers billets
  • /top Les liens les plus partagés
  • /search Rechercher dans les billets
  • /discussion Rechercher une discussion
  • /syncfeeds Synchroniser la liste des shaarlis
  • /countlinks Retourne le nombre de shaares enregistrés

Options

  • &format=json
  • &pretty=true

Samples

Cron usage

Simple feeds refresh (feeds will be sync if the database is fresh new):

php cron.php

Feeds refresh and seek for new feeds:

php cron.php --sync

Can also be used as a daemon. No output (todo log?). New feeds will be fetch regularly:

php cron.php --daemon

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.4%
  • ApacheConf 0.6%