-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgenerate_mock_previews.py
More file actions
64 lines (54 loc) · 2.08 KB
/
generate_mock_previews.py
File metadata and controls
64 lines (54 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
Generate mock preview data for demonstration purposes.
Note: This uses mock data because the reference creative agent at
https://creative.adcontextprotocol.org doesn't currently return
structured format data via MCP (it returns a text message instead).
This demonstrates what the preview URL feature would look like
when connected to a properly implemented ADCP creative agent.
"""
import json
from pathlib import Path
def main():
"""Generate mock preview URLs."""
# Mock preview data that demonstrates the feature
mock_previews = [
{
"format_id": "display_300x250",
"name": "Display 300x250",
"preview_url": "https://creative.adcontextprotocol.org/preview/sample-banner/desktop.html",
"width": 300,
"height": 250,
},
{
"format_id": "display_728x90",
"name": "Display 728x90 Leaderboard",
"preview_url": "https://creative.adcontextprotocol.org/preview/sample-leaderboard/desktop.html",
"width": 728,
"height": 90,
},
{
"format_id": "display_160x600",
"name": "Display 160x600 Skyscraper",
"preview_url": "https://creative.adcontextprotocol.org/preview/sample-skyscraper/desktop.html",
"width": 160,
"height": 600,
},
]
# Save to JSON
output_file = Path(__file__).parent / "preview_urls.json"
with open(output_file, "w") as f:
json.dump(mock_previews, f, indent=2)
print("✅ Generated mock preview URLs")
print(f"💾 Saved to: {output_file}")
print()
print("Mock previews:")
for preview in mock_previews:
print(f" - {preview['name']}: {preview['preview_url']}")
print()
print("🌐 Open examples/web_component_demo.html in a browser to see them!")
print()
print("Note: These are mock URLs for demonstration. In a real implementation,")
print("the preview URLs would be generated by calling preview_creative on the")
print("creative agent for each format.")
if __name__ == "__main__":
main()