From 47ef41636fbb971fa3bb54343abfbc00750486f8 Mon Sep 17 00:00:00 2001 From: xmengnet <51263043+xmengnet@users.noreply.github.com> Date: Sat, 8 May 2021 19:27:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2aur=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worker/mner.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 worker/mner.py diff --git a/worker/mner.py b/worker/mner.py new file mode 100644 index 0000000..3f06d05 --- /dev/null +++ b/worker/mner.py @@ -0,0 +1,27 @@ +import requests + +from zzcore import StdAns + + +class Ans(StdAns): + def GETMSG(self): + if len(self.parms) < 2: + msg = '请输入包名 如:/mner yjun' + return msg + else: + msg = '' + req = requests.get( + url='https://aur.archlinux.org/rpc/?v=5&type=search&by=maintainer&arg=' + self.parms[1]).json() + count = req['resultcount'] + if count != 0: + msg += '工具人 ' + self.parms[1] + ' 打包了' + str(count) + '个软件\n' + soft='' + if count < 5: + # soft = list() + for i in range(count): + soft= req['results'][i]['Name'] + else: + for i in range(5): + soft+=req['results'][i]['Name']+'\n' + soft+='....' + return msg+soft