Shariff (social share)

Fred_4346f29d
Shariff (social share)
Fred#4346f29d Friday 2nd June 2017, 20:19:31

image
Shariff enables website users to share their favorite content without compromising their privacy.
Facebook, Google+ and Twitter supply official sharing code snippets which quietly siphon personal data from all page visitors. Shariff enables visitors to see how popular your page is on Facebook and share your content with others without needless data leaks.

Download: shariff.zip (1.5 Ko)
2018/01/24 - Version 2.1.1:
* [+] Update script in last version
* [-] Remove backend (impossible to make it work)
2017/06/02 - Version 1.0.2:
* [+] cache folder
* [+] added backend url in configuration
2017/06/02 - Version 1.0:
* Initial version
Last modified: Wednesday 24th January 2018, 09:44:36

Replies 17
Fred_4346f29d
Fred#4346f29d  Saturday 3rd June 2017, 15:16:35

Good !
I do not understand how the backend works, to display the counters.
I integrated it here even is I already shared messages, but I do not see any counter ...
If you can tell me more smile

identicon
AlexanderLiebrecht  Sunday 4th June 2017, 04:42:16

 
Hello @Fred,
I help you super gladly, because I now just adjusted your Plugin and the Share Counts are displayed. But probably one has to use all share Buttons more, rather all counts are displayed. Look at this at https://flatboard.wpzweinull.ch/view.php/topic/2017-06-0314163488cd0.
The file index.php under /plugin/shariff/backend looks with me like this. It's original and I just added my domain and defined the 'tmp' directory.

<?php
require_once __DIR__.'/vendor/autoload.php';
use Heise\Shariff\Backend;
/**
 * Demo Application using Shariff Backend
 */
class Application
{
    /**
     * Sample configuration
     *
     * @var array
     */
    private static $configuration = [
        'cache' => [
            'ttl' => 60,
              'cacheDir' => 'tmp'
        ],
        'domains' => [
            'flatboard.wpzweinull.ch',
            'www.ct.de'
        ],
        'services' => [
            'GooglePlus',
            'Facebook',
            'LinkedIn',
            'Reddit',
            'StumbleUpon',
            'Flattr',
            'Pinterest',
            'Xing',
            'AddThis'
        ]
    ];
    public static function run()
    {
        header('Content-type: application/json');
        $url = isset($_GET['url']) ? $_GET['url'] : '';
        if ($url) {
            $shariff = new Backend(self::$configuration);
            echo json_encode($shariff->get($url));
        } else {
            echo json_encode(null);
        }
    }
}
Application::run();


You must create a directory /tmp in the directory /plugin/shariff/backend. This gets CHMOD privileges of 777 to make it PHP-writable.
If you then call in the browser: http://mydomain.com/plugin/shariff/backend will display a Json value "null". Then the Shariff backend worked.
Please check it out after you have looked at the index.php.
We need this information in the index.php.

 'cache' => [
'ttl' => 60,
  'cacheDir' => 'tmp'

That would be all we have to do.

Fred_4346f29d
Fred#4346f29d  Sunday 4th June 2017, 19:09:47

Thank a lot Alexander,
Plugin update to 1.0.2 with cache folder and backend link.
Thank to try it again and give me yours feedback's wink

identicon
AlexanderLiebrecht  Monday 5th June 2017, 12:16:24

 
Hi @Fred,
The share counts only worked through this small customization.
Look at this, please.
 
private static $configuration = [
  'cache' => [
'ttl' => 60,
'cacheDir' => 'tmp'
  ],
  'domains' => [
'flatboard.wpzweinull.ch'
  ],
  'services' => [
'GooglePlus',
'Facebook',
'LinkedIn',
'Reddit',
'StumbleUpon',
'Flattr',
'Pinterest',
'Xing',
'AddThis'
  ]
];

Perhaps you should also leave the / tmp directory in the index.php.
Then everyone can enter their domain.
I have made these adjustments now and the share counts have been displayed again.
The link to the Shariff backend in the plugin options is correct.

identicon
AlexanderLiebrecht  Monday 5th June 2017, 13:02:46

 
Just saw that you have no directory /tmp in the plugin download package. This must still be pure. Then note it in the index.php and already should function.
/cache directory, so it does not seem to work. I wanted to tell you more.

Fred_4346f29d
Fred#4346f29d  Monday 5th June 2017, 23:04:23

Ok, get the new index.php here and try it.
The script create the tmp folder in the backend folder, is good?
On the author script, i get a error in backend...

identicon
AlexanderLiebrecht  Tuesday 6th June 2017, 03:06:40

 
Very strange, but with me it is only with the index.php of Github from the Repository. Your index.php is good, but no share counts are displayed.
What else can we do? If you say it generates errors with you, the index.php does not go by the Author.
On my Webhosting it seems to work.
The /tmp directory is just right. I always create this manually, if none is present.
Hm ... what else can you do?

simon_20a65f4f
Simon  Wednesday 24th January 2018, 07:45:48

The "backend" button does not work :