Wed Jun 15 2005 14:35 You're So Vague:
I think this song is about you, don't I, don't I?
Wed Jun 15 2005 14:35 You're So Vague:
Wed Jun 15 2005 21:15 Del Eat:
No packaging; I'll just put it inline for those interested. You need the Eater, of course, and Beautiful Soup (or one of those fancy del.icio.us-Python interfaces with all the XML dependencies).
#!/usr/bin/python
#Del Eat
#by Leonard
import urllib2
import os
import sys
from BeautifulSoup import BeautifulSoup
from eater import WordEndingEater
if len(sys.argv) != 4:
print 'Usage: %s [username] [password] [path to Eater prefix file]' \
% sys.argv[0]
sys.exit(1)
username, password, path = sys.argv[1:]
if not os.path.exists(path):
print 'No such Eater prefix file: %s' % path
sys.exit(1)
authinfo = urllib2.HTTPBasicAuthHandler()
authinfo.add_password('del.icio.us API', 'http://del.icio.us',
username, password)
opener = urllib2.build_opener(authinfo)
xml = BeautifulSoup(opener.open('http://del.icio.us/api/tags/get').read())
eater = WordEndingEater(path)
print '<ul>'
for tag in xml('tag'):
eaten = eater.eatWord(tag['tag'], 'text')
print '<li><a href="http://del.icio.us/tag/%s/">%s</a></li>' % (eaten,
eaten)
print '</ul>'