Skip to content

Instantly share code, notes, and snippets.

@dragere
dragere / ddnetMapExtraction.py
Last active March 8, 2022 16:31
Scrape released maps on the ddnet releases page
import requests
from bs4 import BeautifulSoup
import re
import pandas as pd
#returns [server, name, link, mapper, difficulty, points, year, date, time]
def handleMapList(m):
out = [
re.search(">(.*) Server<", str(m.select_one('h2 > a'))).group(1),
@dragere
dragere / pytid
Last active August 8, 2021 16:19 — forked from zombified/pytid
Python File Saver HTTP Server for TiddlyWiki 5
#!/usr/bin/env python3
"""
TiddlyWiki 5 saver in the form of a Python 3 http.server.
Start script in directory with TiddlyWiki's, go to http://localhost:8181,
select the TiddlyWiki you want, and this server should handle saving via
TiddlyWiki 5 PUT save method.
Based on: https://gist.github.com/jimfoltz/ee791c1bdd30ce137bc23cce826096da
- why not just use the Ruby one? some environments don't have Ruby, some
@dragere
dragere / tiddlyflask.py
Created August 8, 2021 15:53
TiddlyWiki5 server python script
import sys
from flask import Flask, request, make_response, send_file
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class TiddlyWiki(Resource):