lunduke-cli/examples/draft_post.py

21 lines
464 B
Python
Raw Normal View History

2025-04-12 16:30:44 +00:00
from lunduke.client import DiscourseClient
def main():
client = DiscourseClient()
2025-04-12 16:30:44 +00:00
try:
draft_data = {
"title": "Simple forum post",
"raw": "Simple forum post content"
}
response = client.post('/posts.json', data=draft_data)
print(f"Draft created successfully: {response}")
except Exception as e:
print(f"Error creating draft: {e}")
if __name__ == "__main__":
main()