29 lines
951 B
Python
29 lines
951 B
Python
import root
|
|
import blogs
|
|
|
|
rss_feed_path = f"{root.path}/rss"
|
|
url = "https://deadvey.com"
|
|
|
|
with open(rss_feed_path, "w") as rss_file:
|
|
content = f'''<?xml version="1.0" encoding="UTF-8" ?>
|
|
<rss version="2.0">
|
|
<channel>
|
|
<title>DeaDvey</title>
|
|
<link>{url}</link>
|
|
<description>Linux, tech and reviews</description>
|
|
<pubDate>{blogs.blogs_array[0][2]} +0000</pubDate>
|
|
<lastBuildDate>{blogs.blogs_array[0][2]} +0000</lastBuildDate>
|
|
'''
|
|
for current_blog in range(len(blogs.blogs_array)-1,0,-1):
|
|
content += f'''
|
|
<item>
|
|
<title>{blogs.blogs_array[current_blog][0]}</title>
|
|
<link>https://deadvey.com/blog/{current_blog}.html</link>
|
|
<description>{blogs.blogs_array[current_blog][1]}</description>
|
|
<pubDate>{blogs.blogs_array[current_blog][2]} +0000</pubDate>
|
|
</item>
|
|
'''
|
|
|
|
content += "</channel>\n\n</rss>"
|
|
rss_file.write(content)
|