Skip to content

Latest commit

 

History

History

docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Introduction

getMe

Get the profile of yourself.

Examples

getMe().then((res) => {
 console.log(res);
});

Returns Promise<Object>

getPendingFields

Get the pending fields.

Examples

getPendingFields().then((res) => {
 console.log(res);
});

Returns Promise<Object>

updateMe

Update your profile.

Parameters

Examples

const data = {...}; //key listed above could be used.
updateMe(data).then((res) => {
 console.log(res);
});

Returns Promise<Object>

listComments

Search posts by specified keyword.

Parameters

  • options object - @param {Number} options.after provide a number to list comments after the provided number.
    • @param {Boolean} popular true | false
  • id Number post id

Examples

const postId = 225688036;
const options = {};
listComments(postId, options).then((res) => {
  console.log(res);
});

listDarsysPosts

"You may also like these posts" based on a post id

Parameters

Examples

const id = 225688036;
listDarsysPosts(id).then((res) => {
  console.log(res);
});

getDcard

Get today's Dcard.

Examples

getDcard().then((res) => {
 console.log(res);
});

Returns json

acceptDcard

Send invitation to today's Dcard.

Parameters

  • firstMessageForm object
    • firstMessageForm.firstMessage string The message that you want to say.

Examples

const message = { firstMessage: 'Hello!' };
acceptDcard(message).then((res) => {
  console.log(res);
});

Returns json

reportDcard

Reort Dcard.

Parameters

  • reportForm Object
    • reportForm.reason String {reason: 'profileEmpty | profileSexual | photoNotReal | photoNotClear | photoNudity | photoOthers'}

Returns json

getDcardStatus

Get dcard's status

Returns json

listPost

List Posts of a forum

Parameters

  • options object
    • options.forum String vehicle for instance, please refer to docs/forumList.json to get forum name.
    • options.before String List posts before a post id
    • options.after String List posts after a post id
    • options.popular Boolean true | false

Examples

const options = {
  forum: 'vehicle',
  popular: false,
  before: 225687456,
};
listPost(options).then((res) => {
  console.log(res);
});

listMyPost

List your posts. login required.

Parameters

  • options object
    • options.before String List posts before a post id

Examples

const options = {
  before: 225687456,
};
listMyPost(options).then((res) => {
  console.log(res);
});

listMySubscription

List your subscriptions. login required.

Parameters

Examples

const options = {
  popular: true,
};
listMySubscription(options).then((res) => {
  console.log(res);
});

getPost

Get content of a specified post id.

Parameters

Examples

const postId = 225688036;
const options = {};
getPost(postId, options).then((res) => {
  console.log(res);
});

searchPost

Search posts by specified keyword.

Parameters

Examples

const options = {
  query: '愛情',
};
searchPost(options).then((res) => {
  console.log(res);
});

createSession

Login to Dcard with email and password.

Parameters

Examples

createSession({ email: 'abc@example.com', password: 'Passw0rd' }).then((res) => {
  console.log(res);
});

Returns Promise<Object>