Skip to content

Instantly share code, notes, and snippets.

@drdrang
Created December 23, 2015 13:47
Show Gist options
  • Save drdrang/d7d5301db2f1cfce80f8 to your computer and use it in GitHub Desktop.
Save drdrang/d7d5301db2f1cfce80f8 to your computer and use it in GitHub Desktop.
Check the entries of a list of feeds for content/value and summary items.
#!/usr/bin/env python
# coding=utf8
import feedparser as fp
import time
from datetime import datetime, timedelta
import pytz
subscriptions = [
'http://feedpress.me/512pixels',
'http://www.leancrew.com/all-this/feed/',
'http://ihnatko.com/feed/',
'http://blog.ashleynh.me/feed',
'http://www.betalogue.com/feed/',
'http://bitsplitting.org/feed/',
'http://feedpress.me/jxpx777',
'http://kieranhealy.org/blog/index.xml',
'http://blueplaid.net/news?format=rss',
'http://brett.trpstra.net/brettterpstra',
'http://feeds.feedburner.com/NerdGap',
'http://www.libertypages.com/clarktech/?feed=rss2',
'http://feeds.feedburner.com/CommonplaceCartography',
'http://kk.org/cooltools/feed',
'http://danstan.com/blog/imHotep/files/page0.xml',
'http://daringfireball.net/feeds/main',
'http://david-smith.org/atom.xml',
'http://feeds.feedburner.com/drbunsenblog',
'http://stratechery.com/feed/',
'http://www.gnuplotting.org/feed/',
'http://feeds.feedburner.com/jblanton',
'http://feeds.feedburner.com/IgnoreTheCode',
'http://indiestack.com/feed/',
'http://feedpress.me/inessential',
'http://feeds.feedburner.com/JamesFallows',
'http://feeds.feedburner.com/theendeavour',
'http://feed.katiefloyd.me/',
'http://feeds.feedburner.com/KevinDrum',
'http://www.kungfugrippe.com/rss',
'http://lancemannion.typepad.com/lance_mannion/rss.xml',
'http://www.caseyliss.com/rss',
'http://www.macdrifter.com/feeds/all.atom.xml',
'http://mackenab.com/feed',
'http://hints.macworld.com/backend/osxhints.rss',
'http://macsparky.com/blog?format=rss',
'http://www.macstories.net/feed/',
'http://www.marco.org/rss',
'http://merrillmarkoe.com/feed',
'http://mjtsai.com/blog/feed/',
'http://feeds.feedburner.com/mygeekdaddy',
'http://nathangrigg.net/feed.rss',
'http://onethingwell.org/rss',
'http://schmeiser.typepad.com/penny_wiseacre/rss.xml',
'http://feeds.feedburner.com/PracticallyEfficient',
'http://robjwells.com/rss',
'http://www.red-sweater.com/blog/feed/',
'http://feedpress.me/sixcolors',
'http://feedpress.me/candlerblog',
'http://inversesquare.wordpress.com/feed/',
'http://high90.com/feed',
'http://joe-steel.com/feed',
'http://feeds.veritrope.com/',
'http://xkcd.com/atom.xml',
'http://doingthatwrong.com/?format=rss']
# Check the entries of each feed.
for s in subscriptions:
f = fp.parse(s)
try:
blog = f['feed']['title']
except KeyError:
blog = s
print blog
try:
e = f['entries'][0]
try:
body = e['content'][0]['value']
print " Content/value: Yes"
except KeyError:
print " Content/value: No"
try:
body = e['summary']
print " Summary: Yes"
except KeyError:
print " Summary: No"
except KeyError:
print " No entries"
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment