|
@@ -0,0 +1,65 @@
|
|
1
|
+##GMU Laundry##
|
|
2
|
+
|
|
3
|
+A site that scrapes http://gmu.esuds.net and creates a pretty graph of the
|
|
4
|
+current machine usage data for each hall.
|
|
5
|
+
|
|
6
|
+This used to be part of my personalsite project (which is a django site), but I
|
|
7
|
+decided to make this it's own website.
|
|
8
|
+
|
|
9
|
+##Getting Started##
|
|
10
|
+
|
|
11
|
+* Git clone the repo: `git clone https://github.com/thallada/laundry`
|
|
12
|
+* Set-up a database. Create a `secrets.py` file in the `laundry/` folder
|
|
13
|
+ with the following variables set:
|
|
14
|
+ * SECRET_KEY
|
|
15
|
+ * DATABASE_NAME
|
|
16
|
+ * DATABASE_USER
|
|
17
|
+ * DATABASE_PASSWORD
|
|
18
|
+ * DATABASE_HOST
|
|
19
|
+* Modify the `ADMINS` variable in `settings.py` so you get emails when the site
|
|
20
|
+ errors (happens when eSuds changes something on their site).
|
|
21
|
+* Run syncdb: `python manage.py syncdb`
|
|
22
|
+* Import the GMU Laundry Hall data: `python manage.py loaddata laundry.json`
|
|
23
|
+* Run the server: `python manage.py runserver`
|
|
24
|
+
|
|
25
|
+##Errors##
|
|
26
|
+
|
|
27
|
+Whoever is in the `ADMINS` variable in `settings.py` will get an e-mail whenever
|
|
28
|
+an error on the site occurs. This most likely happens when eSuds changes
|
|
29
|
+something on their site that breaks the webscraper (which is in `laundry.py`).
|
|
30
|
+
|
|
31
|
+The most often change is that machines are added or removed from halls on the
|
|
32
|
+eSuds website. To fix this issue you will need to manually modify the database
|
|
33
|
+entry for the hall in the django shell. For example, adding a washer to
|
|
34
|
+Whitetop Hall:
|
|
35
|
+
|
|
36
|
+`python manage.py shell`
|
|
37
|
+
|
|
38
|
+```python
|
|
39
|
+>>> from laundry_app.models import Hall, LaundryMachine
|
|
40
|
+>>> whitetop = Hall.objects.get(name="Whitetop")
|
|
41
|
+>>> LaundryMachine.objects.create(number=10, type=LaundryMachine.WASHER, hall=whitetop)
|
|
42
|
+```
|
|
43
|
+
|
|
44
|
+The number is from the eSuds site in the chart for the hall (under the
|
|
45
|
+"Washer #" column).
|
|
46
|
+
|
|
47
|
+Sometimes errors happen when eSuds goes down too. Nothing we can really do about
|
|
48
|
+that, but perhaps we can improve our downtime by caching previous results and
|
|
49
|
+showing those in the intrim.
|
|
50
|
+
|
|
51
|
+##Todo##
|
|
52
|
+
|
|
53
|
+Move away from Django to Javascript. There's no real reason to have a backend
|
|
54
|
+for this site. It can just query esuds and make a chart in D3 or something.
|
|
55
|
+Django is a lot of overhead for such a small site.
|
|
56
|
+
|
|
57
|
+Add weekly usage stats. I was in the process of writing this but never finished.
|
|
58
|
+It's a lot more complicated than the current usage stats because a record of
|
|
59
|
+historical queries needs to be kept somehow.
|
|
60
|
+
|
|
61
|
+Host this on a SRCT server. Right now it's somewhere that I probably only have
|
|
62
|
+control over and with a database at MIT that I might loose access to eventually.
|
|
63
|
+
|
|
64
|
+Make the site more reliable to eSuds changing, like machines getting added or
|
|
65
|
+removed from halls.
|