A Swift implementation of a basic API for Tildes.net
This is an incomplete and imperfect implementation. As long as this message is still here, no support is guaranteed, and breaking changes may happen at any point. Documentation is incomplete. Some parts may be broken or incomplete because this was ripped from a larger project and has not been properly modularized yet.
Comment
BasicComment
FeedItem
Post
MarkdownString
FeedOrder
FeedOrderPeriod
CommentOrder
SBNotification
CreatePostResponse
UserPageType
UserPageResponse
logIntoAccount
async
- parameters:
username: String
,password: String
- returns:
error: String?
- if
error
==2fa
, you should followup with a call totwoFactorLogin
- if
error
isnil
, the login was successful - if
error
is notnil
and not2fa
, then some error occurrred.
- if
- parameters:
twoFactorLogin
async
- parameters:
code: String
- returns:
error: String?
- if
error
isnil
, the login was successful - if
error
is notnil
, some error occurred.
- if
- parameters:
logout
async
- returns:
error: String?
- returns:
loadNotifications
async
- parameters:
unread: Bool
->false
means load read notifications,true
means load unread notifications - returns:
notifications: [SBNotification]
- WARNING: Currently this only fetches the first page
- parameters:
loadFeed
async
- parameters:
group: String?
,order: FeedOrder
,period: FeedOrderPeriod?
,after: String?
,search: String?
,unfiltered: Bool
- returns:
(items: [FeedItem], isFiltered: Bool?, error: String?)
- parameters:
-
loadPost
async
- parameters:
id: String
,group: String
,commentOrder: CommentOrder
- returns:
(post: Post, comments: [Comment])?
- parameters:
-
createPost
async
- parameters:
group: String
,title: String
,link: String
,markdown: String
,tags: [String]
- returns:
CreatePostResponse
- parameters:
-
editPost
async
- parameters:
id: String
,body: String
- returns:
(statusCode: Int, newBody: String)
- WARNING: Currently this can only edit the post BODY
- parameters:
-
replyToPost
async
-
deletePost
async
-
putVoteOnPost
async
-
deleteVoteOnPost
async
-
putBookmarkOnPost
async
-
deleteBookmarkOnPost
async
-
putIgnoreOnPost
async
-
deleteIgnoreOnPost
async
editComment
async
deleteComment
async
replyToComment
async
putVoteOnComment
async
deleteVoteOnComment
async
putBookmarkOnComment
async
deleteBookmarkOnComment
async
markCommentRead
async
loadGroups
async
subscribeToGroup
async
unsubscribeFromGroup
async
loadUserPage
async
- paginated