eprintsug / altmetric

Altmetric integration for EPrints
2 stars 1 forks source link

Altmetric blocking libwww-perl user agent strings #7

Open drn05r opened 2 years ago

drn05r commented 2 years ago

I have noticed that on several repository the Altmetric box is returning:

An error has occured whilst retrieving data from Altmetric.

Further investigation finds that this is due to using the user agent string libwww-perl/VERSION. I have added the following to cgi/altmetric the line after the $ua is instantiated and this seems to fix the issue:

$ua->agent( 'eprints/' . EPrints->human_version );

drn05r commented 2 years ago

P.S. In the process of debugging this I noticed the z_altmetric.pl still uses an HTTP rather than HTTPS API URL. This looks to get redirected without issue but I updated this just in case during my debugging. I think it may be worth updating it in the packaged z_altmetric.pl.

jesusbagpuss commented 2 years ago

Looks like we've both been investigating the same thing! The above correlates with what I discovered too. I've asked the Altmetric Support people if a bit more info too.

jesusbagpuss commented 2 years ago

Support ticket with Altmetric: https://help.altmetric.com/support/tickets/401411

yurj commented 1 year ago

Still an issue?

jesusbagpuss commented 1 year ago

Hi @yurj, The 'user agent' fix suggested here works.

Are you in a position to test the following package? https://github.com/jesusbagpuss/altmetric/blob/autobuild-epm/altmetric.epm

This has been automatically built using GitHub actions, and contains a few other improvements. If it is OK, I'll merge my fork back into eprintsug version and upload to the Bazaar.

yurj commented 1 year ago

I'm not using the plugin, just investigating if It can work if used. But I can test it in a Eprint test instance to see if it works. Maybe @drn05r did it already.