Methods
(inner) actions(postId, paramsopt) → {Promise}
- Source:
Retrieve actions executed against a post.
Parameters:
Name |
Type |
Attributes |
Description |
postId |
string
|
Number
|
|
A post id |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) bookmark(postId) → {Promise}
- Source:
Bookmark a post.
Example
pnut.bookmark(123);
Parameters:
Name |
Type |
Description |
postId |
string
|
A post id |
Returns:
-
Type
-
Promise
(inner) bookmarks(userId, paramsopt) → {Promise}
- Source:
Retrieve a list of bookmarks made by the specified user.
Example
pnut.bookmarks(1);
Parameters:
Name |
Type |
Attributes |
Description |
userId |
string
|
Number
|
|
A post id |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) createPost(text, optionsopt) → {Promise}
- Source:
Create a post.
Examples
pnut.createPost("An awesome post").then(res => {
console.log(res);
});
pnut.createPost("An awesome post", {nsfw: true}).then(res => {
console.log(res);
});
pnut.createPost("An awesome post", {
nsfw: true
replyTo: 1234,
parseLinks: false,
parseMarkdownLinks: false
}).then(res => {
console.log(res);
});
pnut.createPost("Awesome post with raw data", {
raw: {
type: "io.pnut.core.language",
value: {
language: "en"
}
}
});
Parameters:
Name |
Type |
Attributes |
Description |
text |
string
|
|
text for a new post |
options |
Object
|
<optional>
|
Optional arguments
Properties
Name |
Type |
Attributes |
Description |
nsfw |
boolean
|
<optional>
|
Optional boolean whether the post should be marked as "NSFW" (Not Safe For Work/mature/offensive) |
replyTo |
string
|
Number
|
<optional>
|
Optional ID of another post to reply to |
parseLinks |
boolean
|
<optional>
|
Optional boolean whether the links should be parsed by the server. Defaults to true. |
parseMarkdownLinks |
boolean
|
<optional>
|
Optional boolean whether the markdown links should be parsed by the server. Defaults to true. |
|
Returns:
-
Type
-
Promise
(inner) deleteBookmark(postId) → {Promise}
- Source:
Remove a bookmark for a post.
Example
pnut.deleteBookmark(123);
Parameters:
Name |
Type |
Description |
postId |
string
|
Number
|
A post id |
Returns:
-
Type
-
Promise
(inner) deletePost(postId) → {Promise}
- Source:
Delete a post.
Example
pnut.deletePost(123);
Parameters:
Name |
Type |
Description |
postId |
string
|
Number
|
A post id |
Returns:
-
Type
-
Promise
(inner) deleteRepost(postId) → {Promise}
- Source:
Delete a repost.
Example
pnut.deleteRepost(123);
Parameters:
Name |
Type |
Description |
postId |
string
|
Number
|
A post id |
Returns:
-
Type
-
Promise
(inner) global(paramsopt) → {Promise}
- Source:
A stream of all users' public posts.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) personal(paramsopt) → {Promise}
- Source:
The authenticated user's stream of posts from their followers and themself.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) post(postId, paramsopt) → {Promise}
- Source:
Retrieve a post object.
Parameters:
Name |
Type |
Attributes |
Description |
postId |
string
|
Number
|
|
A post id |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) posts(ids) → {Promise}
- Source:
Retrieve a list of specified post objects. Only retrieves the first 200 found.
Parameters:
Name |
Type |
Description |
ids |
string
|
Number
|
Post ids, max 200 |
Returns:
-
Type
-
Promise
(inner) postsTaggedWith(tag, paramsopt) → {Promise}
- Source:
Retrieve a stream of all posts that include the specified tag.
Parameters:
Name |
Type |
Attributes |
Description |
tag |
string
|
|
– A tag name |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) repost(postId) → {Promise}
- Source:
Repost another post.
Example
pnut.repost(123);
Parameters:
Name |
Type |
Description |
postId |
string
|
Number
|
A post id |
Returns:
-
Type
-
Promise
(inner) revisions(postId, paramsopt) → {Promise}
- Source:
Retrieve a list of previous versions of a post, not including the most recent.
Parameters:
Name |
Type |
Attributes |
Description |
postId |
string
|
Number
|
|
A post id |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) searchPosts(params) → {Promise}
- Source:
Retrieve a list of posts filtered by the given criteria.
Example
pnut.searchPosts({
tags: ["mndp", "MondayNightDanceParty"]
});
Parameters:
Name |
Type |
Description |
params |
Object
|
|
Returns:
-
Type
-
Promise
(inner) thread(postId, paramsopt) → {Promise}
- Source:
Retrieve posts within a thread.
Parameters:
Name |
Type |
Attributes |
Description |
postId |
string
|
Number
|
|
A post id |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) unified(paramsopt) → {Promise}
- Source:
A combined Personal Stream including the authenticated user's mentions.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise
(inner) updatePost(postId, newText) → {Promise}
- Source:
Edit / revise a post.
Example
pnut.updatePost(123, updatedText);
Parameters:
Name |
Type |
Description |
postId |
string
|
Number
|
A post id |
newText |
string
|
new text for a post |
Returns:
-
Type
-
Promise
(inner) usersActions(paramsopt) → {Promise}
- Source:
Retrieve actions executed against the authenticated user and their posts.
Parameters:
Name |
Type |
Attributes |
Description |
params |
Object
|
<optional>
|
Additional URI parameters |
Returns:
-
Type
-
Promise