How to Track Pizza Delivery
Someone has put up a Dominoes pizza order tracking script using their XML feed. Cool!
#!/usr/bin/env python
import xml.dom.minidom
import urllib, sys, datetime
class Dominos:
def __init__(self, *args, **kw):
self.__feed_url = "http://trkweb.dominos.com/orderstorage/GetTrackerData"
def get_order_info(self, phone_number):
xml_data = urllib.urlopen('%s?Phone=%s' % (self.__feed_url, phone_number))
dom = xml.dom.minidom.parse(xml_data)
orders_node = dom.getElementsByTagName('OrderStatuses')
order = orders_node[0].getElementsByTagName('OrderStatus')
if order.length > 0:
description = order[0].getElementsByTagName('OrderDescription')[0].firstChild.data
starttime = self.get_time(order[0].getElementsByTagName('StartTime')[0].firstChild)
oventime = self.get_time(order[0].getElementsByTagName('OvenTime')[0].firstChild)
racktime = self.get_time(order[0].getElementsByTagName('RackTime')[0].firstChild)
routetime = self.get_time(order[0].getElementsByTagName('RouteTime')[0].firstChild)
deliverytime = self.get_time(order[0].getElementsByTagName('DeliveryTime')[0].firstChild)
return {'description':description, 'starttime':starttime, 'deliverytime':deliverytime,
'oventime':oventime, 'racktime':racktime, 'routetime':routetime}
else:
return False
def get_time(self, time_node):
if time_node:
[date, time] = time_node.data.split("T")
[hour, minute, second] = time.split(":")
ampm = 'pm'
if hour < 12:
ampm = 'am'
return '%s:%s%s' % (int(hour) % 12, minute, ampm)
else:
return None
if __name__ == "__main__":
if len(sys.argv) != 2:
print 'usage: %s ' % sys.argv[0]
sys.exit(1)
print """Dominos (R) pizza tracker."""
d = Dominos()
order_info = d.get_order_info(sys.argv[1])
if not order_info:
print "No Orders Found for %s" % sys.argv[1]
else:
print order_info['description']
if order_info['starttime']: print "Your pizza is being made! %s" % order_info['starttime']
if order_info['oventime']: print "Your pizza is in the oven! %s" % order_info['oventime']
if order_info['racktime']: print "Your pizza is done and awaiting delivery! %s" % order_info['racktime']
if order_info['routetime']: print "Your pizza is on the way! %s" % order_info['routetime']
if order_info['deliverytime']: print "Your pizza was delivered! %s" % order_info['deliverytime']
How to Get More Vacation Time
Americans simultaneously get the least vacation in the 1st world, while not producing the most wealth per hour. We only get 2 weeks off per year on average and work 60-plus hours per week. However, this gentleman I met yesterday has come up with a novel-to-me way to get more time off.
He'll work from August/September till May/June, live frugally in the US, and spend the rest of the year in the beach resort of Curçao, Venezuela. It sounds like a wonderful life and one that would give me a heart attack, because I value consistency, above damn near everything else.
How to Defeat Microsoft E-reader DRM 1
I recently downloaded an ebook in Microsoft's DRM'd ebook format. I hate DRM of all kinds. I bought the blood book, I own it. If I want to keep it on my machine forever and go through it anytime, that should be my right. Enough philosophy, time for action.
You will need a PDF printer -- the free PDF Creator is what I used. This creates a virtual printer that saves the document as PDF. The ebook reader allows you to print a document. Print to your virtual printer and there you are. DRM defeated.
How to Speed up your Dryer
Lifehacker claims that tennis balls will speed up your laundry. I ran this by my cousin in NYC, who pointed me to tennis-ball like dryer balls at Target and swears by them. Let me know if it works for you.
If you'd like more tips, 49 of them, just go to lifehackery.
