beercan 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/tools/upload_post.js +12 -13
- package/package.json +1 -1
|
@@ -53,25 +53,25 @@ export const tools = [
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const data = await response.json();
|
|
56
|
-
|
|
56
|
+
// API returns { success, profile: { social_accounts: { platform: { handle, ... } } } }
|
|
57
|
+
const socialAccounts = data?.profile?.social_accounts || data?.social_accounts || {};
|
|
58
|
+
const platformNames = Object.keys(socialAccounts);
|
|
57
59
|
|
|
58
|
-
if (
|
|
60
|
+
if (platformNames.length === 0) {
|
|
59
61
|
return [
|
|
60
62
|
"No social networks connected yet.",
|
|
61
63
|
`Go to ${markSupremeUrl} → Platforms to connect.`,
|
|
62
|
-
"Supported: Twitter
|
|
64
|
+
"Supported: x (Twitter), instagram, tiktok, linkedin, reddit, threads, facebook, youtube, pinterest, bluesky",
|
|
63
65
|
].join("\n");
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
let result = `Connected platforms for profile "${profile}":\n`;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
result += JSON.stringify(accounts, null, 2);
|
|
68
|
+
let result = `Connected platforms for profile "${profile}" (${platformNames.length}):\n`;
|
|
69
|
+
for (const [platform, info] of Object.entries(socialAccounts)) {
|
|
70
|
+
const details = info;
|
|
71
|
+
result += `\n● ${platform} — @${details.handle || details.display_name || "connected"}`;
|
|
73
72
|
}
|
|
74
|
-
result += `\n\
|
|
73
|
+
result += `\n\nUse these exact platform names when posting: ${platformNames.join(", ")}`;
|
|
74
|
+
result += `\nManage connections: ${markSupremeUrl}`;
|
|
75
75
|
return result;
|
|
76
76
|
} catch (err) {
|
|
77
77
|
return `Cannot reach Upload-Post API: ${err.message}\nManage at: ${markSupremeUrl}`;
|
|
@@ -128,8 +128,7 @@ export const tools = [
|
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
addField("user", profile);
|
|
131
|
-
addField("
|
|
132
|
-
if (title) addField("title", title);
|
|
131
|
+
addField("title", content); // "title" is the main post text for Upload-Post API
|
|
133
132
|
if (subreddit) addField("subreddit", subreddit);
|
|
134
133
|
|
|
135
134
|
// Each platform as separate "platform[]" field
|