PracticeDev/migrate-blog/hexo_to_typecho/test_pytypecho.py
2024-09-04 18:18:33 +08:00

13 lines
360 B
Python

from pytypecho import Typecho
typecho_url = "https://oskyla.com/action/xmlrpc"
typecho_username = 'songtianlun'
typecho_password = 'sotilu,typecho2019'
te = Typecho(typecho_url, typecho_username, typecho_password)
posts = te.get_posts(10)
#print(posts)
for post in posts:
print(post.get('title', "Untitled"), " - ", post.get('postid'))
print(len(posts))