I hereby claim:
- I am aapris on github.
- I am aapris (https://keybase.io/aapris) on keybase.
- I have a public key whose fingerprint is C06C C956 FA69 D9C7 2F71 01EF 20A9 AA27 8D69 8920
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
""" | |
Sometimes you need to pass forward HttpRequest, which is not directly serializable. | |
serialize_django_request() takes Django HttpRequest as an argument, extracts | |
HttpRequest.headers (available since Django 2.2), HttpRequest.body and most interesting | |
values out from HttpRequest.META and returns them in a dict which is json, msgpack etc. | |
serializable. | |
""" | |
from django.http.request import HttpRequest |
# Pretty print your Foursquare history | |
# remember to "pip install requests ics" into you virtualenv | |
import sys | |
import requests | |
from ics import Calendar | |
ics_data = requests.get(sys.argv[1]).text | |
cal = Calendar(ics_data) | |
for e in cal.events: | |
print("{} | {}".format(e.begin.format('YYYY-MM-DD HH:mm:ss ZZ'), e.name.lstrip('@ '))) |
I hereby claim:
To claim this, I am signing this object: