aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--piccast/feeds/management/commands/scrape_feeds.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/piccast/feeds/management/commands/scrape_feeds.py b/piccast/feeds/management/commands/scrape_feeds.py
index 6a85aef..bfa9bfc 100644
--- a/piccast/feeds/management/commands/scrape_feeds.py
+++ b/piccast/feeds/management/commands/scrape_feeds.py
@@ -170,9 +170,10 @@ def scrape_feed(feed_shortname):
# Ok, this is where we split out and do custom, per-site processing
if(feed_shortname == u"acidcow"):
- p.description = strip_tags(pset['description'])
- if(p.description.starts_with(u"Simlar posts:"):
- p.description = None
+ if(len(pset['description']) > 0):
+ p.description = strip_tags(pset['description'])
+ if(p.description.startswith(u"Similar posts:")):
+ p.description = None
p.save()
print "Great, saved: " + p.title + " (id=" + str(p.id) + ")"
scrape_pics_acidcow(p)
@@ -203,8 +204,9 @@ class Command(BaseCommand):
for shortname in args:
try:
scrape_feed(shortname)
- except Exception:
- sys.stderr.write("Error scraping " + shortname + "\n")
+ except Exception as e:
+ sys.stderr.write("Error scraping " + shortname + ":\n")
+ sys.stderr.write(str(e) + "\n")
sys.stdout.flush()
sys.stdout.write('Done scraping feeds.\n')