Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Collect 'NPRI in the News' items in 'in-the-news.csv'

  • Loading branch information...
commit c0aa6e848b59fb8019a93fb7f841274017ece2e2 1 parent 0a47728
Eric Davis authored February 03, 2012

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  newsclips2.py
8  newsclips2.py
@@ -34,6 +34,7 @@
34 34
     log = logging.getLogger('newsclips2.main')
35 35
 
36 36
     data = tablib.Dataset(headers=HEADERS)
  37
+    in_the_news = tablib.Dataset(headers=("date", "media", "title", "url"))
37 38
 
38 39
     for line in args.input:
39 40
         item = collections.defaultdict(str)
@@ -87,6 +88,10 @@ def duplicate(self):
87 88
 
88 89
         data.append([item[key] for key in HEADERS])
89 90
 
  91
+        if 'in the news' in line.lower():
  92
+            in_the_news.append([
  93
+                    item["date"], item["media"], item["title"], item["url"]])
  94
+
90 95
         if mention.duplicate():
91 96
             _item = item.copy()
92 97
             _item['orig'] = ''
@@ -102,3 +107,6 @@ def duplicate(self):
102 107
 
103 108
     with open(args.output, 'wb') as fp:
104 109
         fp.write(data.xls)
  110
+
  111
+    with open("in-the-news.csv", "w") as fp:
  112
+        fp.write(in_the_news.csv)

0 notes on commit c0aa6e8

Please sign in to comment.
Something went wrong with that request. Please try again.