-
Notifications
You must be signed in to change notification settings - Fork 0
/
firebot.py
36 lines (29 loc) · 1.05 KB
/
firebot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import subprocess
import sys
from wikipedia import wikipedia
from jabberbot import *
class Fire_bot(JabberBot):
@botcmd
def whois(self, mess, args):
"""Displays whois information of a domain or ip"""
return subprocess.check_output(['whois', '-H', args]).strip()
@botcmd
def youtube(self, mess, args):
"""Generates download link for youtube video"""
return subprocess.check_output(['youtube-dl', '-g', args]).strip()
@botcmd
def free(self, mess, args):
"""Displays system memory information"""
return subprocess.check_output(['free', '-m']).strip()
@botcmd
def wiki(self, mess, args):
"""Fetch 2 sentences of a wikipedia article"""
return wikipedia.summary(args, sentences=2)
@botcmd
def file(self, mess, args):
"""Displays contents of a file"""
return subprocess.check_output(['cat', args]).strip()
username = 'user@192.168.1.2'
password = 'pass'
fire_bot = Fire_bot(username, password)
fire_bot.serve_forever()