generated from kazbo/python-project-template
add files
This commit is contained in:
parent
bb5169bf19
commit
db34654ace
5 changed files with 35 additions and 19 deletions
6
.vscode/launch.json
vendored
6
.vscode/launch.json
vendored
|
@ -2,12 +2,12 @@
|
|||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type" : "debugpy",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"name": "Launch project",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"module": "python-project-template",
|
||||
"module": "rss-mastodon-poster"
|
||||
//"args": ["run", "python", "-m", "python-project-template"],
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
|
@ -9,6 +9,7 @@ package-mode = false
|
|||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
feedparser = "^6.0.11"
|
||||
|
||||
|
||||
[build-system]
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# !/usr/bin/env python3
|
||||
|
||||
def main():
|
||||
print("Hello World!")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
22
rss-mastodon-poster/__main__.py
Normal file
22
rss-mastodon-poster/__main__.py
Normal 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()
|
Loading…
Reference in a new issue