Return to Snippet

Revision: 16756
at August 14, 2009 16:38 by halotis


Initial Code
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (C) 2009 HalOtis Marketing
# written by Matt Warren
# http://halotis.com/
 
import urllib2
try:
    from xml.etree import ElementTree
except ImportError:
    from elementtree import ElementTree
 
#add a dates=YYYY-MM-DD,YYYY-MM-DD argument to the url to get all data in a date range
url_prefix = 'https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri='
 
URIs = ['HalotisBlog',]
 
def print_feedburner(content):
    tree = ElementTree.fromstring(content)
    for feed in tree.findall('feed'):
        print feed.get('uri'), ':'
        for entry in feed.findall('entry'):
            print entry.get('date'), '-', entry.get('reach'), '-', entry.get('circulation'), '-', entry.get('hits')
 
 
if  __name__=='__main__':
 
    for uri in URIs:
        content = urllib2.urlopen(url_prefix + uri).read()
        print_feedburner(content)

Initial URL
http://www.halotis.com/2009/08/13/python-feedburner-awareness-api-script/

Initial Description
prints out the RSS reach, circulation, and hits for a feedburner feed.

Initial Title
Python Feedburner Awareness API Script

Initial Tags
api

Initial Language
Python