mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-25 16:12:39 +00:00
30fe6e6d49
Since we are targeting 3.7+, it should be safe to use them now.
23 lines
651 B
Python
Executable File
23 lines
651 B
Python
Executable File
#!/usr/bin/env python3
|
|
# MIT licensed
|
|
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
|
|
'''show a list of packages maintained by someone in AUR'''
|
|
|
|
import sys
|
|
import json
|
|
import urllib.request
|
|
|
|
def main(user):
|
|
url = f'https://aur.archlinux.org/rpc.php?type=msearch&arg={user}'
|
|
res = urllib.request.urlopen(url)
|
|
if res.status != 200:
|
|
sys.exit(f'Error: {res.status} {res.reason}')
|
|
d = res.read().decode('utf-8')
|
|
d = json.loads(d)
|
|
print('\n'.join(sorted(pkg['Name'] for pkg in d['results'])))
|
|
|
|
if __name__ == '__main__':
|
|
main(sys.argv[1]) if len(sys.argv) == 2 else \
|
|
sys.exit('whose packages do you want to see?')
|