Giter VIP home page Giter VIP logo

shaarli2mastodon's Introduction

Shaarli2Mastodon

This plugin allows you to automatically publish links you post on your Mastodon timeline.

It is largely inspired by ArthurHoaro's shaarli2twitter and uses an adapted version of TootoPHP.

Requirements

  • PHP 5.3
  • PHP cURL extension
  • Shaarli >= v0.8.1 in public mode (which is the default mode)

Installation

1. Create the application in Mastodon

On your Mastodon instance, go to Preferences > Development > Your applications and create a new one.

You can use whatever you want as name and website but if you have no idea, I suggest shaarli2mastodon and https://github.com/kalvn/shaarli2mastodon.

In Scopes, chose only write permission and validate.

Your new application should appear in the list. Click on it and keep the first 3 settings visible, you'll need them for next step.

2. Install the plugin

You must download and copy the files under /plugins/shaarli2mastodon directory of your Shaarli installation. There are several ways to do so. Here, I'll be using Git.

Run the following command from within the /plugins directory:

$ git clone https://github.com/kalvn/shaarli2mastodon

Make sure these new files are readable by your web server (Apache, Nginx, etc.).

Then, on your Shaarli instance, go to Plugin administration page and activate the plugin.

3. Configure the plugin

Your parameters from step 1 will be used here. After plugin activation, you'll see 5 parameters.

  • MASTODON_INSTANCE: Your Mastodon instance, example: mastodon.xyz
  • MASTODON_APPID: Mastodon application ID
  • MASTODON_APPSECRET: Mastodon application secret
  • MASTODON_APPTOKEN: Mastodon application token
  • MASTODON_TOOT_FORMAT: The format of your toots. Available placeholders:
    • ${url}: URL of link shared
    • ${permalink}: permalink of the share
    • ${title}: title of the share
    • ${description}: description of the share
    • ${tags}: tags of the share, prefixed with # to be valid Mastodon tags

Tests

After you installed PHPUnit, you can run unit tests with:

$ phpunit tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.