|
| 1 | +# class Telegraph(object): |
| 2 | + |
| 3 | +## Methods defined here: |
| 4 | +### \_\_init\_\_ |
| 5 | + |
| 6 | +- access_token (default: `None`) — Telegraph access token |
| 7 | + |
| 8 | +### create_account |
| 9 | + Create a new Telegraph account |
| 10 | +- short_name — Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name |
| 11 | +- author_name (default: `None`) — Default author name used when creating new articles |
| 12 | +- author_url (default: `None`) — Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channels |
| 13 | +- replace_token (default: `True`) — Replaces current token to a new user's token |
| 14 | + |
| 15 | +### create_page |
| 16 | + Create a new Telegraph page |
| 17 | +- title — Page title |
| 18 | +- content (default: `None`) — Content in nodes list format (see doc) |
| 19 | +- html_content (default: `None`) — Content in HTML format |
| 20 | +- author_name (default: `None`) — Author name, displayed below the article's title |
| 21 | +- author_url (default: `None`) — Profile link, opened when users click on the author's name below the title |
| 22 | +- return_content (default: `False`) — If true, a content field will be returned |
| 23 | + |
| 24 | +### edit_account_info |
| 25 | + Update information about a Telegraph account. Pass only the parameters that you want to edit |
| 26 | +- short_name (default: `None`) — Account name, helps users with several accounts remember which they are currently using. Displayed to the user above the "Edit/Publish" button on Telegra.ph, other users don't see this name |
| 27 | +- author_name (default: `None`) — Default author name used when creating new articles |
| 28 | +- author_url (default: `None`) — Default profile link, opened when users click on the author's name below the title. Can be any link, not necessarily to a Telegram profile or channels |
| 29 | + |
| 30 | +### edit_page |
| 31 | + Edit an existing Telegraph page |
| 32 | +- path — Path to the page |
| 33 | +- title — Page title |
| 34 | +- content (default: `None`) — Content in nodes list format (see doc) |
| 35 | +- html_content (default: `None`) — Content in HTML format |
| 36 | +- author_name (default: `None`) — Author name, displayed below the article's title |
| 37 | +- author_url (default: `None`) — Profile link, opened when users click on the author's name below the title |
| 38 | +- return_content (default: `False`) — If true, a content field will be returned |
| 39 | + |
| 40 | +### get_access_token |
| 41 | + Return current access_token |
| 42 | + |
| 43 | +### get_account_info |
| 44 | + Get information about a Telegraph account |
| 45 | +- fields (default: `None`) — List of account fields to return. Available fields: short_name, author_name, author_url, auth_url, page_count Default: [“short_name”,“author_name”,“author_url”] |
| 46 | + |
| 47 | +### get_page |
| 48 | + Get a Telegraph page |
| 49 | +- path — Path to the Telegraph page (in the format Title-12-31, i.e. everything that comes after [http://telegra.ph/](http://telegra.ph/)) |
| 50 | +- return_content (default: `True`) — If true, content field will be returned |
| 51 | +- return_html (default: `True`) — If true, returns HTML instead of Nodes list |
| 52 | + |
| 53 | +### get_page_list |
| 54 | + Get a list of pages belonging to a Telegraph account sorted by most recently created pages first |
| 55 | +- offset (default: `0`) — Sequential number of the first page to be returned (default = 0) |
| 56 | +- limit (default: `50`) — Limits the number of pages to be retrieved (0-200, default = 50) |
| 57 | + |
| 58 | +### get_views |
| 59 | + Get the number of views for a Telegraph article |
| 60 | +- path — Path to the Telegraph page |
| 61 | +- year (default: `None`) — Required if month is passed. If passed, the number of page views for the requested year will be returned |
| 62 | +- month (default: `None`) — Required if day is passed. If passed, the number of page views for the requested month will be returned |
| 63 | +- day (default: `None`) — Required if hour is passed. If passed, the number of page views for the requested day will be returned |
| 64 | +- hour (default: `None`) — If passed, the number of page views for the requested hour will be returned |
| 65 | + |
| 66 | +### revoke_access_token |
| 67 | + Revoke access_token and generate a new one, for example, if the user would like to reset all connected sessions, or you have reasons to believe the token was compromised. On success, returns dict with new access_token and auth_url fields |
| 68 | + |
0 commit comments