Added pump.py (props wrk)

This commit is contained in:
Dionysus 2023-06-24 21:14:12 -04:00
parent 0f8fac3887
commit c8a9f77afd
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE

21
scripts/python/pump.py Normal file
View File

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# pump ascii from the ircart repo script for weechat - developed by wrk
import time
import weechat
import requests
import random
def cmd_pump(data, buf, name):
ascii_list=requests.get("https://raw.githubusercontent.com/ircart/ircart/master/ircart/.list").text.split("\n")
asc=""
if name == '':
asc=random.choice(ascii_list)
else:
asc=[i for i in ascii_list if name in i][0]
data=requests.get(f"https://raw.githubusercontent.com/ircart/ircart/master/ircart/{asc}.txt").text
weechat.command(buf, f'/input send {data}')
return weechat.WEECHAT_RC_OK
if weechat.register('pump', 'wrk', '1.0', 'ISC', 'pump', '', ''):
weechat.hook_command('pump', 'pumpit name', '<text>', '', '', 'cmd_pump', '')