weechat

- me personal weechat setup 🔵🟢
git clone git://git.acid.vegas/weechat.git
Log | Files | Refs | Archive | README

pump.py (728B)

      1 # -*- coding: utf-8 -*-
      2 # pump ascii from the ircart repo script for weechat - developed by wrk
      3 
      4 import time
      5 import weechat
      6 import requests
      7 import random
      8 
      9 def cmd_pump(data, buf, name):
     10 	ascii_list=requests.get("https://raw.githubusercontent.com/ircart/ircart/master/ircart/.list").text.split("\n")
     11 	asc=""
     12 	if name == '':
     13 		asc=random.choice(ascii_list)
     14 	else:
     15 		asc=[i for i in ascii_list if name in i][0]
     16 	data=requests.get(f"https://raw.githubusercontent.com/ircart/ircart/master/ircart/{asc}.txt").text
     17 	weechat.command(buf, f'/input send {data}')
     18 	return weechat.WEECHAT_RC_OK
     19 
     20 if weechat.register('pump', 'wrk', '1.0', 'ISC', 'pump', '', ''):
     21 	weechat.hook_command('pump', 'pumpit name', '<text>', '', '', 'cmd_pump', '')