PageSourceSearch

https://gobytv.com/assets/GobySocialIntegration-CEflNRMt.js

js gobytv.com collected 2026-10-05 19:24:13 UTC 12,537 bytes, 121 lines download raw bytes

1import{ah as p,j as e,ac as u,B as m,E as j,al as f,x as s,y as t,z as a,D as r,ad as g}from"./index-C4LWZPK9.js";import{D as b}from"./download-srkMuRD5.js";function _(){const[o,d]=p.useState(!1),l="https://6a28781830f1b76607fc7eec.base44.app/functions/socialBridge",n="goby1234567890",x=async()=>{await navigator.clipboard.writeText(l),d(!0),setTimeout(()=>d(!1),2e3)},h=()=>{const c=document.createElement("a");c.setAttribute("href","data:text/markdown;charset=utf-8,"+encodeURIComponent(N)),c.setAttribute("download","GOBY_SOCIAL_INTEGRATION_GUIDE.md"),c.style.display="none",document.body.appendChild(c),c.click(),document.body.removeChild(c)},i={search:`{
2  "action": "search",
3  "secret": "${n}",
4  "payload": {
5    "query": "",
6    "limit": 20
7  }
8}`,getMessages:`{
9  "action": "get_fan_messages",
10  "secret": "${n}",
11  "payload": {
12    "author_id": "AUTHOR_ID_HERE"
13  }
14}`,reply:`{
15  "action": "reply",
16  "secret": "${n}",
17  "payload": {
18    "message_id": "MESSAGE_ID",
19    "reply": "Your reply text here",
20    "goby_social_user_id": "USER_ID"
21  }
22}`};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(u,{}),e.jsx("div",{className:"pt-20 pb-24 px-6",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-4xl font-bold font-display mb-4",children:"🎬 Goby TV × Goby Social Integration"}),e.jsx("p",{className:"text-lg text-muted-foreground",children:"Complete API documentation for video search, messaging, and content bridging"})]}),e.jsxs("div",{className:"flex gap-4 mb-8",children:[e.jsxs(m,{onClick:h,className:"gap-2",children:[e.jsx(b,{className:"w-4 h-4"}),"Download Guide"]}),e.jsxs(m,{variant:"outline",onClick:x,className:"gap-2",children:[o?e.jsx(j,{className:"w-4 h-4"}):e.jsx(f,{className:"w-4 h-4"}),o?"Copied!":"Copy Bridge URL"]})]}),e.jsxs(s,{className:"mb-8 bg-gradient-to-r from-primary/10 to-accent/10 border-primary/20",children:[e.jsx(t,{children:e.jsx(a,{className:"flex items-center gap-2",children:"📡 Bridge Endpoint"})}),e.jsxs(r,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"URL"}),e.jsx("code",{className:"block bg-background p-3 rounded-lg mt-1 text-sm font-mono break-all",children:l})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Authentication Secret"}),e.jsx("code",{className:"block bg-background p-3 rounded-lg mt-1 text-sm font-mono",children:n})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Method"}),e.jsx("code",{className:"block bg-background p-3 rounded-lg mt-1 text-sm font-mono",children:"POST"})]})]})]}),e.jsxs(s,{className:"mb-8",children:[e.jsx(t,{children:e.jsx(a,{children:"🔧 Available Endpoints"})}),e.jsx(r,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-left py-3 px-4 font-semibold",children:"Action"}),e.jsx("th",{className:"text-left py-3 px-4 font-semibold",children:"Description"}),e.jsx("th",{className:"text-left py-3 px-4 font-semibold",children:"Returns"})]})}),e.jsxs("tbody",{children:[e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-3 px-4 font-mono",children:"search"}),e.jsx("td",{className:"py-3 px-4",children:"Search published videos"}),e.jsx("td",{className:"py-3 px-4 font-mono",children:"{results: [...]}"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-3 px-4 font-mono",children:"get_fan_messages"}),e.jsx("td",{className:"py-3 px-4",children:"Get pending messages for author"}),e.jsx("td",{className:"py-3 px-4 font-mono",children:"{messages: [...]}"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-3 px-4 font-mono",children:"mark_read"}),e.jsx("td",{className:"py-3 px-4",children:"Mark message as read"}),e.jsx("td",{className:"py-3 px-4 font-mono",children:"{success: true}"})]}),e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"py-3 px-4 font-mono",children:"reply"}),e.jsx("td",{className:"py-3 px-4",children:"Send reply to fan"}),e.jsx("td",{className:"py-3 px-4 font-mono",children:"{success: true}"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-3 px-4 font-mono",children:"decline"}),e.jsx("td",{className:"py-3 px-4",children:"Decline message request"}),e.jsx("td",{className:"py-3 px-4 font-mono",children:"{success: true}"})]})]})]})})})]}),e.jsxs(s,{className:"mb-8",children:[e.jsx(t,{children:e.jsx(a,{children:"💻 Code Examples"})}),e.jsxs(r,{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Search Videos"}),e.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto text-sm font-mono",children:i.search})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Get Fan Messages"}),e.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto text-sm font-mono",children:i.getMessages})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold mb-2",children:"Send Reply"}),e.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto text-sm font-mono",children:i.reply})]})]})]}),e.jsxs(s,{className:"mb-8",children:[e.jsx(t,{children:e.jsx(a,{children:"⚛️ React Component Example"})}),e.jsx(r,{children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto text-sm font-mono max-h-96",children:`// Video Search Component
23const searchVideos = async (query) => {
24  const response = await fetch('${l}', {
25    method: 'POST',
26    headers: { 'Content-Type': 'application/json' },
27    body: JSON.stringify({
28      action: 'search',
29      secret: '${n}',
30      payload: { query, limit: 20 }
31    })
32  });
33  
34  const data = await response.json();
35  return data.results; // Array of videos
36}`})})]}),e.jsxs(s,{className:"mb-8",children:[e.jsx(t,{children:e.jsx(a,{children:"📹 Video Object Schema"})}),e.jsx(r,{children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto text-sm font-mono max-h-96",children:`{
37  "id": "video_id",
38  "title": "Video Title",
39  "description": "Full description",
40  "short_description": "Tagline",
41  "thumbnail_url": "https://...",
42  "video_url": "https://stream.mux.com/...",
43  "duration_seconds": 747,
44  "author_names": ["Director Name"],
45  "categories": ["comedy"],
46  "status": "published",
47  "view_count": 502,
48  "content_rating": "Teen"
49}`})})]}),e.jsxs(s,{className:"mb-8",children:[e.jsx(t,{children:e.jsx(a,{children:"💬 Message Ob
49ject Schema"})}),e.jsx(r,{children:e.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto text-sm font-mono max-h-96",children:`{
50  "id": "message_id",
51  "from_user_id": "user_id",
52  "from_user_name": "Fan Name",
53  "from_user_watch_hours": 10,
54  "to_author_id": "author_id",
55  "to_author_name": "Artist Name",
56  "subject": "Message subject",
57  "message": "Message content",
58  "status": "pending|read|replied|declined",
59  "artist_reply": "Reply text",
60  "artist_replied_at": "2024-01-01T00:00:00Z",
61  "created_date": "2024-01-01T00:00:00Z"
62}`})})]}),e.jsxs(s,{className:"mb-8 bg-accent/10 border-accent/20",children:[e.jsx(t,{children:e.jsx(a,{children:"⚡ Performance Best Practices"})}),e.jsx(r,{children:e.jsxs("ul",{className:"list-disc list-inside space-y-2 text-sm",children:[e.jsx("li",{children:"Debounce search inputs by 300ms to reduce API calls"}),e.jsx("li",{children:"Cache search results for 5 minutes"}),e.jsx("li",{children:"Poll for new messages every 30 seconds"}),e.jsx("li",{children:"Implement retry logic with exponential backoff (1s, 2s, 4s)"}),e.jsx("li",{children:"Use lazy loading for video thumbnails"}),e.jsx("li",{children:"Enable HTTP/2 or HTTP/3 for faster connections"}),e.jsx("li",{children:"Compress images using WebP format"}),e.jsx("li",{children:"Implement infinite scroll for large result sets"})]})})]}),e.jsxs(s,{className:"mb-8",children:[e.jsx(t,{children:e.jsx(a,{children:"🛡️ Error Handling"})}),e.jsx(r,{children:e.jsxs("div",{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{className:"text-destructive",children:"401 Unauthorized"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Invalid or missing secret. Verify authentication."})]}),e.jsxs("div",{children:[e.jsx("strong",{className:"text-destructive",children:"400 Bad Request"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Invalid payload structure. Check required fields."})]}),e.jsxs("div",{children:[e.jsx("strong",{className:"text-destructive",children:"500 Server Error"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Temporary server issue. Implement retry logic."})]}),e.jsxs("div",{children:[e.jsx("strong",{className:"font-semibold text-accent",children:"Retry Strategy"}),e.jsx("pre",{className:"bg-muted p-3 rounded-lg mt-2 text-xs font-mono",children:`// Retry with exponential backoff
63async function fetchWithRetry(url, options, maxRetries = 3) {
64  for (let i = 1; i <= maxRetries; i++) {
65    try {
66      return await fetch(url, options);
67    } catch (error) {
68      if (i === maxRetries) throw error;
69      await new Promise(r => setTimeout(r, Math.pow(2, i-1) * 1000));
70    }
71  }
72}`})]})]})})]}),e.jsxs(s,{children:[e.jsx(t,{children:e.jsx(a,{children:"✅ Setup Checklist"})}),e.jsx(r,{children:e.jsxs("ul",{className:"space-y-2 text-sm",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Replace bridge URL with actual app ID"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Verify secret matches configuration"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Test video search with empty query"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Test video search with specific term"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Verify MUX video player loads streams"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Test message fetching for author"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Test reply and decline functionality"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Enable 30-second message polling"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Add error boundaries in React app"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"rounded"}),"Enable production optimizations"]})]})})]}),e.jsxs("div",{className:"mt-8 text-center text-sm text-muted-foreground",children:[e.jsx("p",{children:"Need help? Contact Goby TV support"}),e.jsx("p",{className:"mt-2",children:"Bridge Version: 1.0.0"})]})]})}),e.jsx(g,{})]})}const N=`# 🎬 GOBY TV × GOBY SOCIAL - COMPLETE INTEGRATION
73
74## 📡 BRIDGE ENDPOINT
75
76\`\`\`
77URL: https://6a28781830f1b76607fc7eec.base44.app/functions/socialBridge
78Method: POST
79Secret: goby1234567890
80\`\`\`
81
82## 🔧 ENDPOINTS
83
84| Action | Description | Returns |
85|--------|-------------|---------|
86| search | Search videos | {results: [...]} |
87| get_fan_messages | Get messages | {messages: [...]} |
88| mark_read | Mark as read | {success: true} |
89| reply | Send reply | {success: true} |
90| decline | Decline message | {success: true} |
91
92## 💻 EXAMPLE USAGE
93
94\`\`\`javascript
95const response = await fetch('https://6a28781830f1b76607fc7eec.base44.app/functions/socialBridge', {
96  method: 'POST',
97  headers: { 'Content-Type': 'application/json' },
98  body: JSON.stringify({
99    action: 'search',
100    secret: 'goby1234567890',
101    payload: { query: '', limit: 20 }
102  })
103});
104
105const data = await response.json();
106console.log(data.results); // Array of videos
107\`\`\`
108
109## ⚡ PERFORMANCE TIPS
110
111- Debounce search: 300ms
112- Cache results: 5 minutes
113- Poll messages: every 30s
114- Retry logic: exponential backoff (1s, 2s, 4s)
115
116## 🛡️ ERROR HANDLING
117
118- 401: Invalid secret
119- 400: Bad request
120- 500: Server error (retry)
121`;export{_ as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.