Added pump.py (props wrk)
This commit is contained in:
parent
0f8fac3887
commit
c8a9f77afd
21
scripts/python/pump.py
Normal file
21
scripts/python/pump.py
Normal 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', '')
|
Loading…
Reference in New Issue
Block a user