Skip to content

Instantly share code, notes, and snippets.

@roadsideseb
Created June 1, 2014 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roadsideseb/a1d60a23c7a2c07f3f9d to your computer and use it in GitHub Desktop.
Save roadsideseb/a1d60a23c7a2c07f3f9d to your computer and use it in GitHub Desktop.
What does the MobifyBlog say about what an employee at Mobify is called?
# -*- coding: utf-8 -*-
from __future__ import print_function
import re
import feedparser
from collections import defaultdict
MOBIF_REGEX = re.compile(r'(?i)mobif\w+')
def main():
feed = feedparser.parse('http://feeds.feedburner.com/MobifyBlog')
terms = defaultdict(int)
for entry in feed.entries:
try:
found = MOBIF_REGEX.findall(entry.summary_detail.value)
except AttributeError:
continue
for term in found:
terms[term.lower()] += 1
print("Here are the stats:")
print()
for term, count in terms.items():
print("{:<15}{:>3}".format(term, count))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment