Skip to content

Commit 11ea690

Browse files
committed
different forks of cloudflare-scrape have different package layouts
1 parent 92041b5 commit 11ea690

3 files changed

Lines changed: 60 additions & 1 deletion

File tree

cloudbot/web/main.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_template_env():
1818

1919
def get_application():
2020
app = Application([
21-
(r'/', TestHandler),
21+
(r'/', StatusHandler),
2222
(r'/factoids/?', TestHandler),
2323
(r'/commands/?', CommandsHandler),
2424
(r"/s/(.*)", StaticFileHandler, {"path": "./cloudbot/web/static"}),
@@ -39,6 +39,20 @@ def get(self):
3939
self.write(template.render(**args))
4040

4141

42+
class StatusHandler(RequestHandler):
43+
@gen.coroutine
44+
def get(self):
45+
template = wi.env.get_template('status.html')
46+
connections = {}
47+
for conn in wi.bot.connections:
48+
pass
49+
args = {
50+
'bot_name': wi.config.get('bot_name', 'Cloud Butt'),
51+
'bot_version': cloudbot.__version__
52+
}
53+
self.write(template.render(**args))
54+
55+
4256
class CommandsHandler(RequestHandler):
4357
@gen.coroutine
4458
def get(self):

cloudbot/web/templates/status.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{% extends "layout.html" %}
2+
{% set active_page = "index" %}
3+
{% block title %}Commands - {{ super() }}{% endblock %}
4+
{% block content %}
5+
<div class="row">
6+
<div class="col-lg-8">
7+
8+
<div class="page-header">
9+
<h4 id="container">Bot Statistics</h4>
10+
</div>
11+
12+
<p class="lead">This page is barely finished. But the bot, uh, works!</p>
13+
14+
15+
</div>
16+
<div class="col-lg-4">
17+
<div style="margin-top: 46px;">
18+
<h4 id="container" style="margin-bottom: 0px;">Current Channels</h4>
19+
</div>
20+
<ul class="nav nav-tabs">
21+
<li class="active"><a href="#home" data-toggle="tab" aria-expanded="true">esper</a></li>
22+
<li class=""><a href="#profile" data-toggle="tab" aria-expanded="false">freenode</a></li>
23+
</ul>
24+
<div id="myTabContent" class="tab-content">
25+
<div class="tab-pane fade active in" id="home">
26+
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua,
27+
retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica.
28+
Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure
29+
terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan
30+
american apparel, butcher voluptate nisi qui.</p>
31+
</div>
32+
<div class="tab-pane fade" id="profile">
33+
<p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
34+
Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four
35+
loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk
36+
aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore
37+
aesthetic magna delectus mollit.</p>
38+
</div>
39+
</div>
40+
</div>
41+
</div>
42+
{% endblock %}

plugins/steamdb.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
from cloudbot import hook
77
from cloudbot.util import web
88

9+
# different forks of cloudflare-scrape have different package layouts
910
try:
1011
from cfscrape import cfscrape
12+
except ImportError:
13+
import cfscrape
1114
except ImportError:
1215
cfscrape = None
1316

0 commit comments

Comments
 (0)