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
22
.vscode/launch.json
vendored
22
.vscode/launch.json
vendored
|
@ -1,13 +1,13 @@
|
||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"type" : "debugpy",
|
"type": "debugpy",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch project",
|
"name": "Launch project",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"module": "python-project-template",
|
"module": "rss-mastodon-poster"
|
||||||
//"args": ["run", "python", "-m", "python-project-template"],
|
//"args": ["run", "python", "-m", "python-project-template"],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ package-mode = false
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.11"
|
python = "^3.11"
|
||||||
|
feedparser = "^6.0.11"
|
||||||
|
|
||||||
|
|
||||||
[build-system]
|
[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