-
Notifications
You must be signed in to change notification settings - Fork 0
API v1
Ross Williams edited this page May 25, 2020
·
7 revisions
Create a wrapper for a given wiki and API version:
from scuttle import scuttle
API_KEY = "eyJ0eXAiOiJKV1QiLC(...)" # Personal Access Token
wiki = scuttle('en', API_KEY, 1)
The wiki here is 'en' and the API version is 1.
If you don't know the domain of your wiki:
print(scuttle(None, API_KEY, 1).wikis())
Find your wiki in the list.
v1 of the API uses a tightly-scoped system and you may have to make multiple requests in order to find the information you need.
For example, if you wanted to get the most recently-created top-level post on the page to which the user Croquembouche's most recent revision was applied:
wiki = scuttle('en', API_KEY, 1)
user_id = wiki.wikidotuser("Croquembouche")['wd_user_id']
revisions = wiki.wikidotuser_revisions(user_id, limit=1, direction='desc')
page_id = revisions[0]['page_id']
# TODO - cannot get scuttle thread id from page
List all wikis:
wiki.wikis()
Get information about a given wiki