Skip to content

Commit fb0c722

Browse files
imgflip docs (#424)
* imgflip docs * Update imgflip.mdx * Apply suggestion from @EricGustin Co-authored-by: Eric Gustin <[email protected]> --------- Co-authored-by: Eric Gustin <[email protected]>
1 parent eaa9e2f commit fb0c722

File tree

9 files changed

+339
-0
lines changed

9 files changed

+339
-0
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Imgflip
2+
3+
import ToolInfo from "@/components/ToolInfo";
4+
import Badges from "@/components/Badges";
5+
import TabbedCodeBlock from "@/components/TabbedCodeBlock";
6+
import TableOfContents from "@/components/TableOfContents";
7+
import ToolFooter from "@/components/ToolFooter";
8+
9+
<ToolInfo
10+
description="Enable agents to create memes with Imgflip."
11+
author="Arcade"
12+
authType="API Key"
13+
versions={["0.1.0"]}
14+
/>
15+
16+
<Badges repo="arcadeai/arcade_imgflip" />
17+
18+
The Arcade Imgflip toolkit provides a pre-built set of tools for interacting with Imgflip. These tools make it easy to build agents and AI apps that can:
19+
20+
- Create memes
21+
- Search for memes
22+
- Get popular meme templates
23+
24+
## Available Tools
25+
26+
These tools are currently available in the Arcade Imgflip toolkit.
27+
28+
<TableOfContents
29+
headers={["Tool Name", "Description"]}
30+
data={[
31+
["Imgflip.SearchMemes", "Search for meme templates by query (Premium feature)"],
32+
["Imgflip.GetPopularMemes", "Get popular meme templates from Imgflip"],
33+
["Imgflip.CreateMeme", "Create a custom meme using an Imgflip template"],
34+
]}
35+
/>
36+
37+
<Tip>
38+
If you need to perform an action that's not listed here, you can [get in touch
39+
with us](mailto:[email protected]) to request a new tool, or [create your
40+
own tools](/home/build-tools/create-a-toolkit) with the [Imgflip auth
41+
provider](/home/auth-providers/imgflip#using-imgflip-auth-in-customtools).
42+
</Tip>
43+
44+
## Imgflip.SearchMemes
45+
46+
<br />
47+
<TabbedCodeBlock
48+
tabs={[
49+
{
50+
label: "Call the Tool with User Authorization",
51+
content: {
52+
Python: [
53+
"/examples/integrations/toolkits/imgflip/search_memes_example_call_tool.py",
54+
],
55+
JavaScript: [
56+
"/examples/integrations/toolkits/imgflip/search_memes_example_call_tool.js",
57+
],
58+
},
59+
}
60+
]}
61+
/>
62+
63+
Search for meme templates by query (Premium feature)
64+
65+
This tool searches through Imgflip's database of over 1 million meme templates
66+
to find ones that match your search query. This is a Premium feature that
67+
requires a paid Imgflip subscription.
68+
69+
**Parameters**
70+
71+
- `query` _(string, required)_ Search query to find meme templates. Be specific for better results.
72+
- `include_nsfw` _(boolean, optional)_ Include not-safe-for-work memes in search results. Defaults to False.
73+
- `limit` _(integer, optional)_ Maximum number of meme templates to return. Defaults to 20.
74+
75+
---
76+
77+
## Imgflip.GetPopularMemes
78+
79+
<br />
80+
<TabbedCodeBlock
81+
tabs={[
82+
{
83+
label: "Call the Tool with User Authorization",
84+
content: {
85+
Python: [
86+
"/examples/integrations/toolkits/imgflip/get_popular_memes_example_call_tool.py",
87+
],
88+
JavaScript: [
89+
"/examples/integrations/toolkits/imgflip/get_popular_memes_example_call_tool.js",
90+
],
91+
},
92+
}
93+
]}
94+
/>
95+
96+
Get popular meme templates from Imgflip
97+
98+
This tool retrieves a list of popular meme templates that can be used
99+
to create custom memes. These templates are ordered by popularity
100+
based on how many times they've been captioned.
101+
102+
**Parameters**
103+
104+
- `limit` _(integer, optional)_ Maximum number of meme templates to return. Defaults to 20.
105+
106+
---
107+
108+
## Imgflip.CreateMeme
109+
110+
<br />
111+
<TabbedCodeBlock
112+
tabs={[
113+
{
114+
label: "Call the Tool with User Authorization",
115+
content: {
116+
Python: [
117+
"/examples/integrations/toolkits/imgflip/create_meme_example_call_tool.py",
118+
],
119+
JavaScript: [
120+
"/examples/integrations/toolkits/imgflip/create_meme_example_call_tool.js",
121+
],
122+
},
123+
}
124+
]}
125+
/>
126+
127+
Create a custom meme using an Imgflip template
128+
129+
This tool creates a custom meme by adding your text to an existing
130+
meme template. You can specify top and bottom text, choose fonts,
131+
and control text sizing.
132+
133+
**Parameters**
134+
135+
- `template_id` _(string, required)_ The meme template ID to use for creation. You can get this from get_popular_memes.
136+
- `top_text` _(string, optional)_ Text to display at the top of the meme. Leave empty if not needed.
137+
- `bottom_text` _(string, optional)_ Text to display at the bottom of the meme. Leave empty if not needed.
138+
- `font` _(Font, optional)_ Font family to use for the text. Defaults to IMPACT.
139+
- `max_font_size` _(integer, optional)_ Maximum font size for the text. Defaults to 50.
140+
- `no_watermark` _(boolean, optional)_ Remove the Imgflip watermark (Premium feature). Defaults to False.
141+
142+
<ToolFooter pipPackageName="arcade_imgflip" />
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Arcade } from "@arcadeai/arcadejs";
2+
3+
const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
const USER_ID = "{arcade_user_id}";
6+
const TOOL_NAME = "Imgflip.CreateMeme";
7+
8+
// Start the authorization process
9+
const authResponse = await client.tools.authorize({
10+
tool_name: TOOL_NAME,
11+
user_id: USER_ID,
12+
});
13+
14+
if (authResponse.status !== "completed") {
15+
console.log(`Click this link to authorize: ${authResponse.url}`);
16+
}
17+
18+
// Wait for the authorization to complete
19+
await client.auth.waitForCompletion(authResponse);
20+
21+
const toolInput = {
22+
template_id: "123456",
23+
top_text: "Hello World",
24+
bottom_text: "This is a test meme",
25+
max_font_size: 50,
26+
no_watermark: false
27+
};
28+
29+
const response = await client.tools.execute({
30+
tool_name: TOOL_NAME,
31+
input: toolInput,
32+
user_id: USER_ID,
33+
});
34+
35+
console.log(response);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from arcadepy import Arcade
2+
3+
client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
USER_ID = "{arcade_user_id}"
6+
TOOL_NAME = "Imgflip.CreateMeme"
7+
8+
auth_response = client.tools.authorize(
9+
tool_name=TOOL_NAME,
10+
user_id=USER_ID,
11+
)
12+
13+
if auth_response.status != "completed":
14+
print(f"Click this link to authorize: {auth_response.url}")
15+
16+
# Wait for the authorization to complete
17+
client.auth.wait_for_completion(auth_response)
18+
19+
tool_input = {
20+
"template_id": "123456",
21+
"top_text": "Hello World",
22+
"bottom_text": "This is a test meme",
23+
"max_font_size": 50,
24+
"no_watermark": False
25+
}
26+
27+
response = client.tools.execute(
28+
tool_name=TOOL_NAME,
29+
input=tool_input,
30+
user_id=USER_ID,
31+
)
32+
print(response)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Arcade } from "@arcadeai/arcadejs";
2+
3+
const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
const USER_ID = "{arcade_user_id}";
6+
const TOOL_NAME = "Imgflip.GetPopularMemes";
7+
8+
// Start the authorization process
9+
const authResponse = await client.tools.authorize({
10+
tool_name: TOOL_NAME,
11+
user_id: USER_ID,
12+
});
13+
14+
if (authResponse.status !== "completed") {
15+
console.log(`Click this link to authorize: ${authResponse.url}`);
16+
}
17+
18+
// Wait for the authorization to complete
19+
await client.auth.waitForCompletion(authResponse);
20+
21+
const toolInput = {
22+
limit: 20
23+
};
24+
25+
const response = await client.tools.execute({
26+
tool_name: TOOL_NAME,
27+
input: toolInput,
28+
user_id: USER_ID,
29+
});
30+
31+
console.log(response);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from arcadepy import Arcade
2+
3+
client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
USER_ID = "{arcade_user_id}"
6+
TOOL_NAME = "Imgflip.GetPopularMemes"
7+
8+
auth_response = client.tools.authorize(
9+
tool_name=TOOL_NAME,
10+
user_id=USER_ID,
11+
)
12+
13+
if auth_response.status != "completed":
14+
print(f"Click this link to authorize: {auth_response.url}")
15+
16+
# Wait for the authorization to complete
17+
client.auth.wait_for_completion(auth_response)
18+
19+
tool_input = {
20+
"limit": 20
21+
}
22+
23+
response = client.tools.execute(
24+
tool_name=TOOL_NAME,
25+
input=tool_input,
26+
user_id=USER_ID,
27+
)
28+
print(response)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Arcade } from "@arcadeai/arcadejs";
2+
3+
const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
const USER_ID = "{arcade_user_id}";
6+
const TOOL_NAME = "Imgflip.SearchMemes";
7+
8+
// Start the authorization process
9+
const authResponse = await client.tools.authorize({
10+
tool_name: TOOL_NAME,
11+
user_id: USER_ID,
12+
});
13+
14+
if (authResponse.status !== "completed") {
15+
console.log(`Click this link to authorize: ${authResponse.url}`);
16+
}
17+
18+
// Wait for the authorization to complete
19+
await client.auth.waitForCompletion(authResponse);
20+
21+
const toolInput = {
22+
query: "doge",
23+
include_nsfw: false,
24+
limit: 10
25+
};
26+
27+
const response = await client.tools.execute({
28+
tool_name: TOOL_NAME,
29+
input: toolInput,
30+
user_id: USER_ID,
31+
});
32+
33+
console.log(response);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from arcadepy import Arcade
2+
3+
client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable
4+
5+
USER_ID = "{arcade_user_id}"
6+
TOOL_NAME = "Imgflip.SearchMemes"
7+
8+
auth_response = client.tools.authorize(
9+
tool_name=TOOL_NAME,
10+
user_id=USER_ID,
11+
)
12+
13+
if auth_response.status != "completed":
14+
print(f"Click this link to authorize: {auth_response.url}")
15+
16+
# Wait for the authorization to complete
17+
client.auth.wait_for_completion(auth_response)
18+
19+
tool_input = {
20+
"query": "doge",
21+
"include_nsfw": False,
22+
"limit": 10
23+
}
24+
25+
response = client.tools.execute(
26+
tool_name=TOOL_NAME,
27+
input=tool_input,
28+
user_id=USER_ID,
29+
)
30+
print(response)

public/images/icons/imgflip.jpg

7.27 KB
Loading

src/components/custom/Toolkits/toolkits-config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,14 @@ const availableTools: Tool[] = [
228228
category: "entertainment",
229229
type: "arcade",
230230
},
231+
{
232+
name: "Imgflip",
233+
image: "imgflip.jpg",
234+
summary: "Create memes with Imgflip",
235+
link: "/toolkits/entertainment/imgflip",
236+
category: "entertainment",
237+
type: "arcade",
238+
},
231239
{
232240
name: "Notion",
233241
image: "notion.png",

0 commit comments

Comments
 (0)