nvchecker/nvchecker/source/cpan.py
Felix Yan 02809b703f
CPAN: Use metacpan fastapi
All docs in metacpan.org currently point to this new API endpoint. The
old API endpoint returns wrong data for e.g. TermReadKey (latest 2.37 vs
API 2.14), and the new API endpoint doesn't have this issue.
2017-03-24 16:50:56 +08:00

13 lines
243 B
Python

from .simple_json import simple_json
# Using metacpan
CPAN_URL = 'https://fastapi.metacpan.org/release/%s'
def _version_from_json(data):
return str(data['version'])
get_version = simple_json(
CPAN_URL,
'cpan',
_version_from_json,
)