Cleanup
parent
a4fc0397e0
commit
43bcdbdad2
46
gen_tdp
46
gen_tdp
|
@ -1,46 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import subprocess,json,os.path,requests
|
||||
from bs4 import BeautifulSoup as bs
|
||||
|
||||
headers = {
|
||||
'Accept-Encoding': 'gzip, deflate, sdch',
|
||||
'Accept-Language': 'en-US,en;q=0.8',
|
||||
'Upgrade-Insecure-Requests': '1',
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
|
||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
|
||||
'Cache-Control': 'max-age=0',
|
||||
'Connection': 'keep-alive',
|
||||
}
|
||||
|
||||
tdp = {}
|
||||
tdp["name"] = "thunix"
|
||||
tdp["url"] = "https://www.thunix.net"
|
||||
tdp["signup_url"] = tdp["url"]+"/signup"
|
||||
users = subprocess.check_output(["/usr/bin/members","tilde"]).decode('ascii').split()
|
||||
users.sort()
|
||||
tdp["user_count"] = len(users)-1
|
||||
tdp["want_users"] = True
|
||||
tdp["admin_email"] = "root@thunix.net"
|
||||
tdp["description"] = "Thunix is a community, centered around access to a public *nix system. Thunix offers shell accounts with complete set of programming tools, and follows a continuous integration-continuous deployment of system configuration."
|
||||
tdpusers = []
|
||||
for user in users:
|
||||
if user=="anton":
|
||||
continue
|
||||
tdpuser = dict(username=user)
|
||||
title = bs(requests.get("https://www.thunix.net/~{}".format(user)).text,"lxml").title
|
||||
if title is None:
|
||||
title = "No title"
|
||||
else:
|
||||
title = title.text
|
||||
tdpuser["title"] = title
|
||||
if os.path.exists(os.path.expanduser("~{}/public_html/index.html".format(user))):
|
||||
tdpuser["mtime"] = os.path.getmtime(os.path.expanduser("~{}/public_html/index.html".format(user)))
|
||||
elif os.path.exists(os.path.expanduser("~{}/public_html/index.htm".format(user))):
|
||||
tdpuser["mtime"] = os.path.getmtime(os.path.expanduser("~{}/public_html/index.htm".format(user)))
|
||||
elif os.path.exists(os.path.expanduser("~{}/public_html/index.php".format(user))):
|
||||
tdpuser["mtime"] = os.path.getmtime(os.path.expanduser("~{}/public_html/index.php".format(user)))
|
||||
tdpusers.append(tdpuser)
|
||||
tdp["users"] = tdpusers
|
||||
|
||||
with open("tilde.json","w") as f:
|
||||
json.dump(tdp,f)
|
|
@ -1,16 +1,15 @@
|
|||
/* TEAM */
|
||||
Your title: ubergeek, naglfar, amcclure, fosslinux
|
||||
Your title: ubergeek, naglfar, fosslinux
|
||||
Site: https://thunix.net, root@thunix.net
|
||||
Location: Frankfurt, Germany
|
||||
|
||||
/* THANKS */
|
||||
Name: ubergeek https://thunix.net/~ubergeek
|
||||
amcclure https://thunix.net/~amcclure
|
||||
naglfar https://thunix.net/~naglfar
|
||||
fosslinux https://thunix.net/~fosslinux
|
||||
|
||||
/* SITE */
|
||||
Last update: 2019/03/22
|
||||
Last update: 2019/10/31
|
||||
Standards: HTML5
|
||||
Components: Apache2, Git, and PHP, Parsedown, Parsedown Extra
|
||||
Software: vim, geany, ansible, wiki.php
|
||||
|
|
Loading…
Reference in New Issue