def write_entries(): svc = BlogClient() title = input('Title: ') content = input('Body contents: ') view_count = int(input('View count (int): ')) # published = datetime.now().isoformat() resp = svc.add_new_entry(title, content, view_count) print() print(f'Created new entry with ID: {resp.json().get("id")}') print()
def write_posts(): svc = BlogClient() title = input('Title: ') views = int(input('View count: ')) content = input('Content: ') resp = svc.add_new_entry(title, content, views) print() print('Create the new post successfully: {}'.format(resp.json().get('id'))) print()