Skip to content

Commit

Permalink
patreon update
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenVanAcker committed Jan 7, 2019
1 parent 3116acc commit b352ca2
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*~
*.swp
_site
patreon/*.csv
8 changes: 8 additions & 0 deletions _includes/patreonlist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Ariyan Suroosh
* Fionnbharr Davies
* Max G
* Calle "Zeta Two" Svensson
* cyberduck
* Pontus Nyberg
* Chuck
* hpmv
8 changes: 1 addition & 7 deletions information/donate.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ Please [contact us] if you want to donate in another way.
Huge Thanks to Our Patrons
==========================

* Ariyan Suroosh
* Calle Svensson
* cyberduck
* Fionnbharr Davies
* Max G
* Pontus Nyberg

{% include patreonlist.md %}

[contact us]: /information/irc.html

27 changes: 27 additions & 0 deletions patreon/patreon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python

import sys, json, csv, pprint

patrons = []

with open(sys.argv[1]) as csvfile:
csvrows = csv.DictReader(csvfile)
for row in csvrows:
name = row["Name"]
pledge = int(row["Pledge $"].replace("$",""))
lifetime = int(row["Lifetime $"].replace("$",""))
status = row["Patron Status"]
details = row["Additional Details"]
since = row["Patronage Since Date"]

if details != "":
name = details

if status == "Active patron":
if lifetime > 0 and pledge >= 5:
patrons += [(name, lifetime, since)]

patreons = sorted(patrons, key=lambda x: x[2])

for (name, lifetime, since) in patreons:
print "* {}".format(name)
12 changes: 12 additions & 0 deletions patreon/update_patreonlist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e
shopt -s nullglob

basedir=$(dirname $(readlink -f $0))
tmpfile=$(mktemp)

cd $basedir
./patreon.py *.csv > $tmpfile
cat $tmpfile | tee ../_includes/patreonlist.md
rm -f $tmpfile

0 comments on commit b352ca2

Please sign in to comment.