update some links and wiki

This commit is contained in:
Ben Harris 2018-10-15 18:29:34 -04:00
parent c5b03666bf
commit ceb3ccbd9f
Signed by untrusted user: ben
GPG Key ID: 4E0AF802FFF7960C
9 changed files with 62 additions and 61 deletions

View File

@ -7,26 +7,43 @@ r.raise_for_status()
out = {}
d = xml.fromstring(r.text)
assert d.tag == "inspircdstats"
def define(name,xps,vfilter=lambda x: x):
global out
out[name] = vfilter(d.findall(xps)[0].text)
define("usercount","./general/usercount",int)
define("channelcount","./general/channelcount",int)
def define(name, xps, vfilter=lambda x: x):
global out
out[name] = vfilter(d.findall(xps)[0].text)
define("usercount", "./general/usercount", int)
define("channelcount", "./general/channelcount", int)
schannels = d.findall("./channellist/channel")
#print(len(schannels))
# print(len(schannels))
channels = []
for schannel in schannels:
channel = dict(name=schannel.findall("channelname")[0].text,usercount=int(schannel.findall("usercount")[0].text))
channel["topic"] = schannel.findall("./channeltopic/topictext")[0].text if schannel.findall("./channeltopic/topictext")[0].text is not None else "No topic set"
# bugfix: if mode s is set and there's a topic, hide the topic
if "s" in schannel.findall("./channelmodes")[0].text.split()[0] and channel["topic"]!="No topic set":
channel["topic"]="Topic hidden"
if channel["name"]=="#secret-sudoers": # no stat output for #secret-sudoers! it's a sekrit club of the ~team sysadmins!
continue
channel["webchatlink"] = "https://web.tilde.chat/?join="+channel["name"].lstrip("#")
channels.append(channel)
channel = dict(
name=schannel.findall("channelname")[0].text,
usercount=int(schannel.findall("usercount")[0].text),
)
channel["topic"] = (
schannel.findall("./channeltopic/topictext")[0].text
if schannel.findall("./channeltopic/topictext")[0].text is not None
else "No topic set"
)
# bugfix: if mode s is set and there's a topic, hide the topic
if (
"s" in schannel.findall("./channelmodes")[0].text.split()[0]
and channel["topic"] != "No topic set"
):
channel["topic"] = "Topic hidden"
if channel["name"] == "#secret-sudoers":
# no stat output for #secret-sudoers! it's a sekrit club of the ~team sysadmins!
continue
channel["webchatlink"] = "https://web.tilde.chat/?join=" + channel["name"].lstrip(
"#"
)
channels.append(channel)
channels.sort(key=lambda x: x["name"].lower())
out["channels"]=channels
#print([x.text for x in d.findall("./channellist/channel/channeltopic/topictext")])
with open("/var/www/tilde.chat/stats.json","w") as f:
json.dump(out,f)
out["channels"] = channels
# print([x.text for x in d.findall("./channellist/channel/channeltopic/topictext")])
with open("/var/www/tilde.chat/stats.json", "w") as f:
json.dump(out, f)

View File

@ -1,17 +1,5 @@
{
"members": [
{
"private_channel": "#fun",
"name": "tilde.fun",
"sysadmins": [
[
"shiki",
"https://tilde.fun/~shiki/"
]
],
"link": "https://tilde.fun",
"description": "Linux machine on the internet where you can get a shell account"
},
{
"private_channel": "#town",
"name": "tilde.town",
@ -55,6 +43,18 @@
],
"link": "https://yourtilde.com",
"description": "basically a social network inside SSH: there is chat, email, forums, games, and lots more."
},
{
"private_channel": "#fun",
"name": "tilde.fun",
"sysadmins": [
[
"shiki",
"https://tilde.fun/~shiki/"
]
],
"link": "https://tilde.fun",
"description": "Linux machine on the internet where you can get a shell account"
}
]
}

View File

@ -18,7 +18,7 @@
<ul class="dropdown-menu" role="menu">
<li><a href="https://quotes.tilde.chat/"><i class="fa fa-comment"></i> ~chat qdb</a></li>
<li><a href="https://web.tilde.chat/"><i class="fa fa-comments-o"></i> ~webchat</a></li>
<li><a href="https://tilde.chat/stats.php"><i class="fa fa-bar-chart"></i> network stats</a></li>
<li><a href="https://tilde.chat/stats/"><i class="fa fa-bar-chart"></i> network stats</a></li>
<li><a href="https://tilde.chat/badges/"><i class="fa fa-shield"></i> status badges</a></li>
</ul>
</li>

View File

@ -1,9 +1,9 @@
<?php $title="stats page";
$desc="stats about tilde.chat and its channels";
include "header.php"; ?>
include __DIR__."/../header.php"; ?>
<h1>stats</h1>
<?php
$stats = json_decode(file_get_contents("stats.json"));
$stats = json_decode(file_get_contents("../stats.json"));
?>
<p>There are <?=$stats->usercount?> users across <?=$stats->channelcount?> channels.</p>
<table class='table table-striped table-bordered table-hover'>
@ -15,5 +15,5 @@ include "header.php"; ?>
</tbody>
</table>
<hr>
<p>Available in <a href="stats.json">JSON format</a>.</p>
<?php include "footer.php"; ?>
<p>Available in <a href="/stats.json">JSON format</a>.</p>
<?php include __DIR__."/../footer.php"; ?>

View File

@ -4,7 +4,7 @@ hi there, welcome to our wiki!
to contribute to the wiki:
* [fork the repo](https://git.tildeverse.org/repo/fork/53)
* [fork the repo](https://tildegit.org/repo/fork/53)
* clone the repo to your local machine (or your public_html folder on the tilde.team box for live testing)
```sh
@ -23,14 +23,14 @@ cp template.md my-new-page.md
* edit as needed!
* commit your changes and [create a pull request](https://git.tildeverse.org/tildeverse/tilde.chat/pulls) :)
* commit your changes and [create a pull request](https://tildegit.org/tildeverse/tilde.chat/pulls) :)
```sh
git add --all
git commit -m "added my-new-page"
git push origin my-new-page # this should match the branch name you created earlier
```
* create a pull request on the [site](https://git.tildeverse.org/tildeverse/tilde.chat) repo
* create a pull request on the [site](https://tildegit.org/tildeverse/tilde.chat) repo
thanks!~

View File

@ -46,7 +46,7 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
<p>welcome to the tilde.chat wiki!</p>
<p>if you want to contribute, check out the
<a href="https://git.tildeverse.org/tildeverse/tilde.chat/src/branch/master/wiki">source</a> and open a PR!
<a href="https://tildegit.org/tildeverse/tilde.chat/src/branch/master/wiki">source</a> and open a PR!
</p>
<hr>
@ -78,7 +78,7 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
<hr>
<?=str_replace("<table", '<table class="table table-striped"', $pg->getContent())?>
<hr>
<a href="https://git.tildeverse.org/tildeverse/tilde.chat/src/branch/master/wiki/pages/<?=$_GET["page"]?>.md">
<a href="https://tildegit.org/tildeverse/tilde.chat/src/branch/master/wiki/pages/<?=$_GET["page"]?>.md">
<i class="fa fa-edit"></i> source
</a>

View File

@ -28,7 +28,7 @@ don't join #chaos or #shitposting unless you want your bot to be spammed to hell
## tilde.team bot starter kit
[khuxkm](https://khuxkm.tilde.team) is hard at work developing a starter kit framework in python that you can use to build your own irc bot. find the [source here](https://git.tildeverse.org/team/teambot). it's installed globally on ~team, so get coding!
[khuxkm](https://khuxkm.tilde.team) is hard at work developing a starter kit framework in python that you can use to build your own irc bot. find the [source here](https://tildegit.org/team/teambot). it's installed globally on ~team, so get coding!
## add your bot to the list below
@ -41,4 +41,4 @@ follow the example of sedbot when you add your bot in a PR to the wiki
+ s/needle/replace/flags
+ most regex character classes match here
+ flags include `g` and `i`
- [source](https://git.tildeverse.org/ben/sedbot)
- [source](https://tildegit.org/ben/sedbot)

View File

@ -15,6 +15,8 @@ some rules adapted from: https://github.com/fizerkhan/irc-etiquette
multiline messages belong in a pastebin. feel free to use https://ttm.sh (`echo text here | curl -F'file=@-;filename=stdin.txt'`) or https://paste.tildeverse.org for a graphical pastebin.
if you have a need to spam many lines or abuse the figlet feature of tildebot, please do so in the appropriate channel (#chaos or #shitposting).
this includes ascii art and/or figlet output. please be considerate.
bot commands belong in #bots. please limit yourself to 2 or 3 commands at a time. spamming commands is unacceptable and subject to the consequences below.
## don't be lazy - read the documentation

View File

@ -1,18 +0,0 @@
---
author: ~ben
published: true
title: irc
description: irc information
category:
- main
---
# [tildeverse irc](https://tilde.chat)
hi tildizens!
the tilde.chat irc network is available at tilde.chat:+6697 (with ssl)
this is the beginning of the [tilde.chat](https://tilde.chat) irc federation! more info on that site.
there is an instance of [thelounge](https://thelounge.chat) webchat at [irc.tilde.team](https://web.tilde.chat) if you don't already have your own client.