1185 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1186 <meta property="og:type" content="website">
1187 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1188
1189
1111 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1112 <meta property="og:type" content="website">
1113 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1114
1115
45// });
46
47// New route to serve images from blob storage
48app.get("/image/:id.png", async (c) => {
49 console.log(c.req)
50 const id = c.req.param("id");
51 console.log({ id })
52 const imageBlob = await blob.get(id);
53 const known = await blob.get("notionDeleteTest")
54 console.log({ known })
55
56 if (!imageBlob) {
57 return c.text("Image not found", 404);
58 }
59
60 return new Response(imageBlob.body, {
61 headers: {
62 "Content-Type": "image/png"
63 }
64 });
84 return c.body(known.body, {
85 headers: {
86 'Content-Type': 'image/png'
87 }
88 })
110 return c.body(known.body, {
111 headers: {
112 'Content-Type': 'image/png'
113 }
114 })
128 return c.body(known.body, {
129 headers: {
130 'Content-Type': 'image/png'
131 }
132 })
21 href: track.track.href,
22 url: track.track.external_urls.spotify,
23 img_url: track.track.album.images[0].url,
24}));
25
45});
46
47// Helper function to upload an image and get a blob reference
48async function uploadImage(agent: AtpAgent, imageUrl: string) {
49 try {
50 // Fetch the image
51 const response = await fetch(imageUrl);
52 if (!response.ok) {
53 console.error(`Failed to fetch image: ${imageUrl}`);
54 return null;
55 }
56
57 // Convert image to blob
58 const imageBlob = await response.blob();
59
60 // Upload blob to Bluesky
61 const uploadedBlob = await agent.uploadBlob(imageBlob, {
62 encoding: response.headers.get("content-type") || "image/jpeg",
63 });
64
65 return uploadedBlob.data.blob;
66 } catch (error) {
67 console.error("Error uploading image:", error);
68 return null;
69 }
94 for (const song of newSongs) {
95 try {
96 // Upload image and get blob reference
97 const thumbBlob = song.img_url ? await uploadImage(agent, song.img_url) : null;
98
99 const postText = `My new favorite song is "${song.track_name}" ${song.url}`;
152 </Col>
153 <Col md={6}>
154 <img src="https://maxm-imggenurl.web.val.run/futuristic-gaming-setup-with-rgb-lights" alt="Setup Gaming" className="img-fluid rounded shadow gaming-image" loading="lazy" />
155 </Col>
156 </Row>
515}
516
517.gaming-image {
518 border: 2px solid #00ffff;
519 box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
152 </Col>
153 <Col md={6}>
154 <img src="https://maxm-imggenurl.web.val.run/futuristic-gaming-setup-with-rgb-lights" alt="Setup Gaming" className="img-fluid rounded shadow gaming-image" loading="lazy" />
155 </Col>
156 </Row>
515}
516
517.gaming-image {
518 border: 2px solid #00ffff;
519 box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
152 </Col>
153 <Col md={6}>
154 <img src="https://maxm-imggenurl.web.val.run/futuristic-gaming-setup-with-rgb-lights" alt="Setup Gaming" className="img-fluid rounded shadow gaming-image" loading="lazy" />
155 </Col>
156 </Row>
515}
516
517.gaming-image {
518 border: 2px solid #00ffff;
519 box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
152 </Col>
153 <Col md={6}>
154 <img src="https://maxm-imggenurl.web.val.run/futuristic-gaming-setup-with-rgb-lights" alt="Setup Gaming" className="img-fluid rounded shadow gaming-image" loading="lazy" />
155 </Col>
156 </Row>
515}
516
517.gaming-image {
518 border: 2px solid #00ffff;
519 box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
1111 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1112 <meta property="og:type" content="website">
1113 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1114
1115
152 </Col>
153 <Col md={6}>
154 <img src="https://maxm-imggenurl.web.val.run/futuristic-gaming-setup-with-rgb-lights" alt="Setup Gaming" className="img-fluid rounded shadow gaming-image" loading="lazy" />
155 </Col>
156 </Row>
515}
516
517.gaming-image {
518 border: 2px solid #00ffff;
519 box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);