pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

python private pastebin - collaborative debugging tool What's a private pastebin?


Posted by signal on Wed 16 Jul 03:29 (modification of post by signal view diff)
report abuse | View followups from Free Word Order | download | new post

  1. import feedparser
  2. import re
  3. import time
  4.  
  5. already_seen = []
  6. links = {}
  7. count = 0
  8.  
  9. while True:
  10.     entries = feedparser.parse("http://xml.metafilter.com/rss.xml").entries
  11.     entries.reverse()
  12.     for e in entries:
  13.         if e.title not in already_seen:
  14.             already_seen.append(e.title)
  15.             count += 1
  16.             summary = re.compile(r'<[^>]*>|&\w*;|').sub('',e.summary)
  17.             summary = re.compile(r'  ').sub(' ', summary)
  18.             print "#",count, "@", e.updated
  19.             print e.title.encode("UTF-8")
  20.             print summary.encode("UTF-8")
  21.             print "---"
  22.             print
  23.     time.sleep(600)

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me