This page outlines the API wrapper of cbmc.py
PARAMETERS:
- None
get_post(params)
⇒ [Post]
Get a post from 麥塊匿名發文平台 with the given parameters.
Param | Type | Description |
---|---|---|
post_id | int | The post ID of the post you want to get. |
api.get_post(post_id=1)
# or
SyncCbmc.get_post(post_id=1) # directly call the method also works if you don't need to use the instance
Get a list of posts from 麥塊匿名發文平台 with the given parameters.
Param | Type | Default | Description |
---|---|---|---|
limit | int | 10 | The number of the posts you want to get. (Max: 300) |
api.get_posts(limit=10)
# or
SyncCbmc.get_posts(limit=10) # directly call the method also works if you don't need to use the instance
get_status(params)
⇒ [dict]
Get the status of a post on 麥塊匿名發文平台.
This method is NOT implemented yet.
Param | Type | Description |
---|---|---|
code | str | The code of the post you want to get the status. |
api.get_status(code="123456")
# or
SyncCbmc.get_status(code="123456") # directly call the method also works if you don't need to use the instance
PARAMETERS:
- None
await get_post(params)
⇒ [Post]
Get a post from 麥塊匿名發文平台 with the given parameters.
Param | Type | Description |
---|---|---|
post_id | int | The post ID of the post you want to get. |
await api.get_post(post_id=1)
# or
await AsyncCbmc.get_post(post_id=1) # directly call the method also works if you don't need to use the instance
Get a list of posts from 麥塊匿名發文平台 with the given parameters.
Param | Type | Default | Description |
---|---|---|---|
limit | int | 10 | The number of the posts you want to get. (Max: 300) |
await api.get_posts(limit=10)
# or
await AsyncCbmc.get_posts(limit=10) # directly call the method also works if you don't need to use the instance
await get_status(params)
⇒ [dict]
Get the status of a post on 麥塊匿名發文平台. This method is NOT implemented yet.
Param | Type | Description |
---|---|---|
code | str | The code of the post you want to get the status. |
await api.get_status(code="123456")
# or
await AsyncCbmc.get_status(code="123456") # directly call the method also works if you don't need to use the instance
PARAMETERS:
- data: [dict]
ATTRIBUTES:
- post_id: [int] - The post ID of the post.
- platform_id: [int] - The platform ID of the post.
- type: [str] - The post type of the post.
- content: [str] - The content of the post.
- photo: [str | None] - The photo url of the post or None if there is no photo.
- admin_post: [bool] - Whether the post is an admin post.
- approve_timestamp: [int] - The timestamp of when the post was approved.
- approve_time: [datetime.datetime] - The time of when the post was approved.
- approve_user: [str] - The user who approved the post.
- fbid: [str] - The Facebook ID of the post.
to_dict()
⇒ [dict]
Convert the post object to a dictionary.
post.to_dict()