# HG changeset patch # User Brian Neal # Date 1460826979 18000 # Node ID b24708086bfcd825fab0f4b7341efd49ee15b7e6 # Parent 5bba39fafad8acbbd637c8bdbf45bbe95c7788cc Check for news stories with http iframes. diff -r 5bba39fafad8 -r b24708086bfc news/management/commands/fix_news_embeds.py --- a/news/management/commands/fix_news_embeds.py Sat Apr 16 00:31:06 2016 -0500 +++ b/news/management/commands/fix_news_embeds.py Sat Apr 16 12:16:19 2016 -0500 @@ -44,6 +44,12 @@ return False root = lxml.html.fragment_fromstring(s, create_parent=True) + + for iframe in root.iter('iframe'): + src = iframe.get('src') + if src and src.startswith('http:'): + print "*" * 5, "iframe with http src -", story.title + for obj in root.iter('object'): if story.version != 0: print "*" * 5, story.title, "bad version!"