Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
84ecf105c2 |
@@ -1,3 +1,4 @@
|
|||||||
import createPost from './create-post/index.js';
|
import createPost from './create-post/index.js';
|
||||||
|
import searchPostByUrl from './search-post-by-url/index.js';
|
||||||
|
|
||||||
export default [createPost];
|
export default [createPost, searchPostByUrl];
|
||||||
|
@@ -0,0 +1,35 @@
|
|||||||
|
import defineAction from '../../../../helpers/define-action.js';
|
||||||
|
|
||||||
|
export default defineAction({
|
||||||
|
name: 'Search post by url',
|
||||||
|
key: 'searchPostByUrl',
|
||||||
|
description: 'Searches a post in a thread by url.',
|
||||||
|
arguments: [
|
||||||
|
{
|
||||||
|
label: 'Post Url',
|
||||||
|
key: 'postUrl',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
variables: true,
|
||||||
|
description: 'Enter whole post url here.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
async run($) {
|
||||||
|
const postUrl = $.step.parameters.postUrl;
|
||||||
|
const urlParts = postUrl.split('/');
|
||||||
|
const handle = urlParts[urlParts.length - 3];
|
||||||
|
const postId = urlParts[urlParts.length - 1];
|
||||||
|
const uri = `at://${handle}/app.bsky.feed.post/${postId}`;
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
uri,
|
||||||
|
};
|
||||||
|
|
||||||
|
const { data } = await $.http.get('/app.bsky.feed.getPostThread', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
|
||||||
|
$.setActionItem({ raw: data });
|
||||||
|
},
|
||||||
|
});
|
@@ -3,6 +3,8 @@ favicon: /favicons/bluesky.svg
|
|||||||
items:
|
items:
|
||||||
- name: Create post
|
- name: Create post
|
||||||
desc: Creates a new post.
|
desc: Creates a new post.
|
||||||
|
- name: Search post by url
|
||||||
|
desc: Searches a post in a thread by url.
|
||||||
---
|
---
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
Reference in New Issue
Block a user