diff --git a/gen_stats b/gen_stats index b827f9f..dc955c8 100755 --- a/gen_stats +++ b/gen_stats @@ -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) diff --git a/members.json b/members.json index 69b488c..f27f504 100644 --- a/members.json +++ b/members.json @@ -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" } ] } diff --git a/navbar.php b/navbar.php index 530d800..00e6880 100644 --- a/navbar.php +++ b/navbar.php @@ -18,7 +18,7 @@ diff --git a/stats.php b/stats/index.php similarity index 75% rename from stats.php rename to stats/index.php index c4c18fe..7814adb 100644 --- a/stats.php +++ b/stats/index.php @@ -1,9 +1,9 @@ +include __DIR__."/../header.php"; ?>

stats

There are usercount?> users across channelcount?> channels.

@@ -15,5 +15,5 @@ include "header.php"; ?>

-

Available in JSON format.

- +

Available in JSON format.

+ diff --git a/wiki/README.md b/wiki/README.md index 9a12f66..9477932 100644 --- a/wiki/README.md +++ b/wiki/README.md @@ -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!~ diff --git a/wiki/index.php b/wiki/index.php index d370758..460323b 100644 --- a/wiki/index.php +++ b/wiki/index.php @@ -46,7 +46,7 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {

welcome to the tilde.chat wiki!

if you want to contribute, check out the - source and open a PR! + source and open a PR!


@@ -78,7 +78,7 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
getContent())?>
- .md"> + .md"> source diff --git a/wiki/pages/bots.md b/wiki/pages/bots.md index 1ab7686..499b668 100644 --- a/wiki/pages/bots.md +++ b/wiki/pages/bots.md @@ -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) diff --git a/wiki/pages/etiquette.md b/wiki/pages/etiquette.md index f6df11e..ff68b6b 100644 --- a/wiki/pages/etiquette.md +++ b/wiki/pages/etiquette.md @@ -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 diff --git a/wiki/pages/irc.md b/wiki/pages/irc.md deleted file mode 100644 index 2ddced7..0000000 --- a/wiki/pages/irc.md +++ /dev/null @@ -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.