查询aur打包数量
This commit is contained in:
parent
2f92854b62
commit
a6e0f95c53
1 changed files with 27 additions and 0 deletions
27
worker/mner.py
Normal file
27
worker/mner.py
Normal file
|
@ -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
|
Loading…
Reference in a new issue