Commit 39402751 authored by David Hamner's avatar David Hamner
Browse files

Supports more blogs

parent 8af0813c
title:Librem 14 News Summary: May 2021
banner_site:https://puri.sm/posts/the-ball-and-supply-chain/
site:https://puri.sm/posts/librem-14-first-boot/
site:https://puri.sm/posts/best-qubes-laptop-is-the-secure-librem-14/
site:https://puri.sm/posts/librem-14-in-video/
site:https://puri.sm/posts/librem-14-runtime-and-charging/
site:https://puri.sm/posts/gaming-on-the-librem-14/
title:Librem 5 News Summary: May 2021
banner_site:https://puri.sm/posts/librem-5-news-summary-may-2021/
......@@ -52,19 +52,22 @@ def wp2email(site_name):
raw_site = download(site_name)
#print(raw_site)
#setup what to look for
start_of_blog = "</li></ul></div></div></section></div></div><p"
start_of_blog = "</li></ul></div></div></section></div></div><"
"</span></li></ul></div></div></section></div></div><p"
end_of_blog = "</p></div></div></div>"
end_of_blog_alt = '<div class="row grid" style="border-top: 1px solid #ccc; border-bottom: 1px solid #ccc;">'
end_of_blog_alt2 = '</p><hr/><div class="grey-wrapper"><h2>'
end_of_blog_alt3 = '</span></div></div></div>'
##print(raw_site)
blog_text = raw_site.split(start_of_blog)[-1]
if end_of_blog_alt in blog_text:
end_of_blog = end_of_blog_alt
elif end_of_blog_alt2 in blog_text:
end_of_blog = end_of_blog_alt2
elif end_of_blog_alt3 in blog_text:
end_of_blog = end_of_blog_alt3
blog_text = blog_text.split(end_of_blog)[0]
#clean up hanging ">" tag
blog_text = ">".join(blog_text.split(">")[1:])
#for line in raw_site.split('\n'):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment