Mercurial > public > sg101
changeset 1076:b24708086bfc
Check for news stories with http iframes.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 16 Apr 2016 12:16:19 -0500 |
parents | 5bba39fafad8 |
children | 26f2b83e7468 |
files | news/management/commands/fix_news_embeds.py |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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!"