| title | Reddit sample | |
|---|---|---|
| description | Simple usage of the Reddit API | |
| integrations |
|
|
| categories |
|
The Reddit sample demonstrates how to interact with Reddit using AutoKitteh's Reddit integration.
The sample includes two separate workflows:
- Create Post - Create a reddit post
- Add a comment - Add a comment on a reddit post
API details:
- Create a new post in a specified subreddit
- Add a comment to an existing post by using the post id from the webhook
- Initialize your Reddit connection through the UI
- Copy the webhook trigger's URL (for the Trigger Workflows section below):
- Hover over the trigger's (i) icon for the webhook you want to use
- Click the copy icon next to the webhook URL for your selected trigger
- (Detailed instructions here)
- Update the
SUBREDDITproject variable with your target subreddit name (without the "r/" prefix)
curl -X POST "${WEBHOOK_URL}" \
-d "title=Hello from AutoKitteh" \
-d "content=This is a test post created with AutoKitteh" \
-d "flair=<FLAIR_ID>"- Replace
WEBHOOK_URLwith the URL ofcreate_post_webhookwebhook in the triggers section. - provide a flair ID, a title and content.
curl -X POST "${WEBHOOK_URL}" \
-d "post_id=<POST_ID>" \
-d "comment=Great post!"- Replace
WEBHOOK_URLwith the URL ofadd_comment_webhookwebhook in the triggers section. - Replace
<POST_ID>with the ID of the Reddit post you want to comment on, and provide the comment.
Follow these detailed instructions to deploy the project on a self-hosted server.