Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS 

Using an HTTP proxy with Universal Feed Parser

without using http_proxy environment variable..

import urllib2, feedparser

proxy = urllib2.ProxyHandler( {"http":"http://your.proxy.here:8080/"} )
d = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml', handlers = [proxy])

RFC-822 compatible dates in RSS feeds

If you're building RSS 2.0 files with .rxml files on your Rails app, this sort of line will get you a valid date/time:

xml.pubDate(p.updated_at.strftime("%a, %d %b %Y %H:%M:%S %z"))


If you're just using strftime someplace else, perhaps in PHP, try:

strftime("%a, %d %b %Y %H:%M:%S %z")

Atom / RSS feed of your GMail account

https://USERNAME:PASSWORD@gmail.google.com/gmail/feed/atom
« Newer Snippets
Older Snippets »
Showing 1-3 of 3 total  RSS