comparison news/management/commands/fix_news_embeds.py @ 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
comparison
equal deleted inserted replaced
1075:5bba39fafad8 1076:b24708086bfc
42 s = html.strip() 42 s = html.strip()
43 if not s: 43 if not s:
44 return False 44 return False
45 45
46 root = lxml.html.fragment_fromstring(s, create_parent=True) 46 root = lxml.html.fragment_fromstring(s, create_parent=True)
47
48 for iframe in root.iter('iframe'):
49 src = iframe.get('src')
50 if src and src.startswith('http:'):
51 print "*" * 5, "iframe with http src -", story.title
52
47 for obj in root.iter('object'): 53 for obj in root.iter('object'):
48 if story.version != 0: 54 if story.version != 0:
49 print "*" * 5, story.title, "bad version!" 55 print "*" * 5, story.title, "bad version!"
50 continue 56 continue
51 for param in obj.iter('param'): 57 for param in obj.iter('param'):