mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-17 20:24:47 +00:00
16 lines
457 B
Python
16 lines
457 B
Python
# MIT licensed
|
|
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
|
|
from nvchecker.api import RichResult
|
|
|
|
# Using metacpan
|
|
CPAN_URL = 'https://fastapi.metacpan.org/release/%s'
|
|
|
|
async def get_version(name, conf, *, cache, **kwargs):
|
|
key = conf.get('cpan', name)
|
|
data = await cache.get_json(CPAN_URL % key)
|
|
return RichResult(
|
|
version = str(data['version']),
|
|
url = f'https://metacpan.org/release/{data["author"]}/{data["name"]}',
|
|
)
|