|
|
@ -33,14 +33,15 @@ def list_snippets(articles):
|
|
|
|
with open('entries/' + article) as f:
|
|
|
|
with open('entries/' + article) as f:
|
|
|
|
text = f.readlines()
|
|
|
|
text = f.readlines()
|
|
|
|
length = len(text)
|
|
|
|
length = len(text)
|
|
|
|
a.append(text[head])
|
|
|
|
a.append(clean(text[head])) # title
|
|
|
|
content = snip_article(find_content(article, length, head, tail), path)
|
|
|
|
content = snip_article(find_content(article, length, head, tail), path)
|
|
|
|
|
|
|
|
|
|
|
|
if content.count('<ul>') > content.count('</ul>'):
|
|
|
|
if content.count('<ul>') > content.count('</ul>'):
|
|
|
|
content += '</ul>'
|
|
|
|
content += '</ul>'
|
|
|
|
a.append(content)
|
|
|
|
a.append(content) # snippet
|
|
|
|
a.append(text[head + 1].replace('<br>',''))
|
|
|
|
a.append(text[head + 1].replace('<br>','')) # timestamp
|
|
|
|
a.append(path)
|
|
|
|
a.append(path) # URL
|
|
|
|
|
|
|
|
a.append(clean(text[head]).replace(' ','+')) # social media title
|
|
|
|
result.append(a)
|
|
|
|
result.append(a)
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|