Popular recipes tagged "meta:requires=sgmllib"http://code.activestate.com/recipes/tags/meta:requires=sgmllib/2004-10-03T17:47:44-07:00ActiveState Code RecipesFix up a message returned by Python 2.4's email module's feed parser (Python)
2004-10-03T17:47:44-07:00Matthew Cowleshttp://code.activestate.com/recipes/users/139430/http://code.activestate.com/recipes/303227-fix-up-a-message-returned-by-python-24s-email-modu/
<p style="color: grey">
Python
recipe 303227
by <a href="/recipes/users/139430/">Matthew Cowles</a>
(<a href="/recipes/tags/network/">network</a>).
Revision 2.
</p>
<p>For good reasons, the email module's new feed parser can return a message that's internally inconsistent. This recipe fixes up one sort of inconsistency that I've seen in the wild.</p>
Extract text from XML document, II (Python)
2004-03-21T09:51:34-08:00Bill Bellhttp://code.activestate.com/recipes/users/98151/http://code.activestate.com/recipes/275370-extract-text-from-xml-document-ii/
<p style="color: grey">
Python
recipe 275370
by <a href="/recipes/users/98151/">Bill Bell</a>
(<a href="/recipes/tags/xml/">xml</a>).
</p>
<p>Alternative way of extracting text from a WF XML source.</p>
FedEX Tracking Information (Python)
2003-12-19T14:26:41-08:00Chris Moffitthttp://code.activestate.com/recipes/users/137137/http://code.activestate.com/recipes/259097-fedex-tracking-information/
<p style="color: grey">
Python
recipe 259097
by <a href="/recipes/users/137137/">Chris Moffitt</a>
(<a href="/recipes/tags/network/">network</a>).
</p>
<p>This short script allows a user to track the current status of a package sent through FedEx. It is meant to be run from the command line and takes 1 option argument (-v) to determine whether or not it shows all tracking information, or just the most recent entry. The user can enter multiple tracking numbers at run time.</p>
Fetch diary entries from Advogato (Python)
2001-06-18T04:43:33-07:00Itamar Shtull-Trauringhttp://code.activestate.com/recipes/users/98053/http://code.activestate.com/recipes/65223-fetch-diary-entries-from-advogato/
<p style="color: grey">
Python
recipe 65223
by <a href="/recipes/users/98053/">Itamar Shtull-Trauring</a>
(<a href="/recipes/tags/web/">web</a>).
</p>
<p>Advogato (<a href="http://www.advogato.org" rel="nofollow">http://www.advogato.org</a>) exports members' diaries in a simple XML format. This script fetches the entries and stores them in a dictionary keyed by date. I assume it can also be used with other virgule sites, such as <a href="http:///www.badvogato.org." rel="nofollow">http:///www.badvogato.org.</a></p>
Strip tags and Javascript from HTML page, leaving only safe tags (Python)
2001-03-19T12:58:08-08:00Itamar Shtull-Trauringhttp://code.activestate.com/recipes/users/98053/http://code.activestate.com/recipes/52281-strip-tags-and-javascript-from-html-page-leaving-o/
<p style="color: grey">
Python
recipe 52281
by <a href="/recipes/users/98053/">Itamar Shtull-Trauring</a>
(<a href="/recipes/tags/web/">web</a>).
</p>
<p>Sometimes we are getting HTML input from the user. We want to only allow valid, undangerous tags, we want all tags to be balanced (i.e. an unclosed <b> will leave all text on your page bold), and we want to strip out all Javascript.</p>
<p>This recipe demonstrates how to do this using the sgmllib parser to parse HTML.</p>