add files

This commit is contained in:
kaz saita 2024-05-05 18:20:06 +09:00
parent bb5169bf19
commit db34654ace
5 changed files with 35 additions and 19 deletions

24
.vscode/launch.json vendored
View file

@ -1,13 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"type" : "debugpy",
"request": "launch",
"name": "Launch project",
"cwd": "${workspaceFolder}",
"module": "python-project-template",
//"args": ["run", "python", "-m", "python-project-template"],
}
]
}
"version": "0.2.0",
"configurations": [
{
"type": "debugpy",
"request": "launch",
"name": "Launch project",
"cwd": "${workspaceFolder}",
"module": "rss-mastodon-poster"
//"args": ["run", "python", "-m", "python-project-template"],
}
]
}

View file

@ -9,6 +9,7 @@ package-mode = false
[tool.poetry.dependencies]
python = "^3.11"
feedparser = "^6.0.11"
[build-system]

View file

@ -1,7 +0,0 @@
# !/usr/bin/env python3
def main():
print("Hello World!")
if __name__ == '__main__':
main()

View file

@ -0,0 +1,22 @@
# !/usr/bin/env python3
import feedparser
import pprint
# rss_url = "https://www.city.taito.lg.jp/rss_news.xml"
rss_url = 'https://notes.kinoshita-lab.org/index.xml'
def main():
parsed = feedparser.parse(rss_url)
for entry in parsed.entries:
print("id: {}".format(entry.id))
print("title: {}".format(entry.title))
print("link: {}".format(entry.link))
print("published: {}".format(entry.published))
# print("description: {}".format(entry.description))
# pprint.pprint(entry)
if __name__ == '__main__':
main()