heiseonline / shariff-backend-php

👮 PHP backend for Shariff. Shariff enables website users to share their favorite content without compromising their privacy.
http://ct.de/-2467514
133 stars 44 forks source link

Reddit not returning share count #171

Closed onli closed 10 months ago

onli commented 3 years ago

Hi, is the list of currently supported services still accurate? Reddit is not getting returned for me.

This is my configuration:

private static $configuration = [
        'cache' => [
            'ttl' => 310
        ],
    'domains' => [
        ],
    'services' => [
            'Facebook',
            'StumbleUpon',
            'Flattr',
            'Pinterest',
            'Xing',
            'AddThis',
            'Buffer',
            'Reddit',
            'Vk'
        ],
        'Facebook' => [
           'app_id' => '...',
           'secret' => '...'
        ]
    ];

But this is the output:

{"facebook":0,"stumbleupon":0,"flattr":0,"pinterest":0,"xing":0,"addthis":0,"buffer":0,"vk":0}

Every service is accounted for, the 0 is okay, but reddit not being in the array is strange.

I tried setting a custom user agent in the reddit client, but so far that changed nothing.

It's my experience that reddit reacts very aggressively when a client is not respecting 429 responses, might that be the issue here?

onli commented 3 years ago

Okay, it works now for me. Setting the user-agent seems to have done the trick, it just took a while.

I'd suggest to add this to the example configuration in the readme:

    'headers' => [
        'User-Agent' => 'shariff/1.0',
    ]
]

Should I open a PR?

richard67 commented 3 years ago

If it's just the readme, I (normal user and contributor, no maintainer or so) would say go for it.

digitalgopnik commented 10 months ago

Can be closed now since @onli's pr (#172) is merged. Thanks for your work! :pray: