Skip to content

Instantly share code, notes, and snippets.

@dpritchett
Created November 17, 2010 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpritchett/704297 to your computer and use it in GitHub Desktop.
Save dpritchett/704297 to your computer and use it in GitHub Desktop.
Parse out the squinkies on ebay that are almost expired
import time, datetime, feedparser
ebay = feedparser.parse(r'http://shop.ebay.com/i.html?rt=nc&_nkw=squinkies&_rss=1')
def timeleft(in_time):
then = int(in_time[:-3])
now = int(time.time())
delta = then - now
#print time.gmtime(then) #sanity debug
return ' '.join([str(delta / 3600), "hours", str((delta % 3600) / 60), \
"minutes", str(delta % 60), "seconds"])
for entry in ebay.entries:
print entry['title'], '\t', entry['link'][:ebay.entries[0]['link'].find('?')]
print '\t', timeleft(entry['endtime'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment