Permalink
Browse files

Handle PennyPressNV links

They're the only organization that publishes PDFs, so our regular HTML
parsing doesn't work.

So create a dummy mention object to return the right values
  • Loading branch information...
1 parent ef929bc commit a0e5feb5d8e976a09fd27586e8d0334fc482a3f9 @edavis committed Jan 6, 2012
Showing with 13 additions and 2 deletions.
  1. +13 −2 newsclips2.py
View
@@ -48,8 +48,19 @@
continue
if line.startswith(('http://', 'https://')):
- mention = Article(line)
- item["url"] = mention.url
+ # Penny Press NV publishes PDFs, so just create a dummy
+ # object
+ if 'pennypressnv.com' in line:
+ class DummyMention(object):
+ def duplicate(self):
+ return False
+ mention = DummyMention()
+ mention.positive = 'Yes'
+ mention.medium = 'Online'
+ mention.format = 'Op-Ed'
+ mention.media = 'Penny Press NV'
+ else:
+ mention = Article(line)
else:
mention = Radio(line)

0 comments on commit a0e5feb

Please sign in to comment.