Skip to content

Instantly share code, notes, and snippets.

View multiplecats
from xml.dom import minidom
xmlstr = """<item>
dom = minidom.parseString(xmlstr)
items = dom.getElementsByTagName('item')
for item in items:
cats = item.getElementsByTagName('category')
lrei /
Created Apr 17, 2012
Flask Rest Api Example Route
@app.route('/users/<username>', methods = ['GET', 'POST', 'PATCH', 'DELETE'])
def api_user(username):
current_user = User.get(request.authorization.username)
app.logger.debug("req.auth.username = %s", request.authorization.username)
# Only "SELF" can access/modify user info
if current_user.username != username:
return unauthorized()
lrei / gist:1510028
Created Dec 22, 2011
Fetch RSS Feeds Using Multiple Processes
View gist:1510028
#!/usr/bin/env python
import Queue
import multiprocessing
import urllib2
import feedparser
import socket
feeds = ['',