Popular recipes tagged "meta:requires=sgmllib" and "web"http://code.activestate.com/recipes/tags/meta:requires=sgmllib+web/2001-06-18T04:43:33-07:00ActiveState Code RecipesFetch 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>