Wed Jun 15 2005 14:35 PST You're So Vague:
I think this song is about you, don't I, don't I?
Wed Jun 15 2005 14:35 PST You're So Vague:
I think this song is about you, don't I, don't I?
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).
Wed Jun 15 2005 21:15 PST Del Eat:
I wrote a tiny script that runs my del.icio.us tags through the Eater of Meaning's WordEndingEater to get different words, and prints links to the tag pages for those words. Sometimes these tags don't go anywhere, like "carpets" or "antedates", but sometimes they're pretty interesting, like "macro" (wonderfully ambiguous) and "twenty". It's fun--until you try it yourself!
#!/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>'
![]() | Unless otherwise noted, all content licensed by Leonard Richardson under a Creative Commons License. |