8 "Andy Dufresne, a banker convicted of murdering his wife and sentenced to life imprisonment at Shawshank State Penitentiary, maintains his innocence and begins a journey of hope and redemption.",
9 "rating": 8.9,
10 "image": "https://m.media-amazon.com/images/M/MV5BMTU4NzAyNTQ1OV5BMl5BanBnXkFtZTcwNTI1OTYzNzM@.jpg",
11 },
12 {
16 "The story of the Corleone family under patriarch Vito Corleone, focusing on the transformation of his youngest son, Michael, from reluctant family outsider to ruthless mafia boss.",
17 "rating": 9.2,
18 "image": "https://m.media-amazon.com/images/M/MV5BMTUyNjQwNzEtZDIzMC00ODc3LWI4MTgtNjQwOTQ5Mjc1M2E@.jpg",
19 },
20 {
24 "Batman raises his stakes in his war on crime when he targets the enigmatic criminal mastermind known as the Joker, a terrorist causing chaos in Gotham City.",
25 "rating": 9.0,
26 "image": "https://m.media-amazon.com/images/M/MV5BNDYxMzUxMTctNmRjOC00ZjFhLWFmNTEtNDJkNzZlMGM5MzQ@.jpg",
27 },
28 {
31 "description": "A jury in New York City deliberates the fate of a young man accused of murdering his father.",
32 "rating": 8.9,
33 "image": "https://m.media-amazon.com/images/M/MV5BMTQ0ODc4MDU4NF5BMl5BanBnXkFtZTgwNTY2NDEyNDE@.jpg",
34 },
35 {
39 "Gandalf and Aragorn lead the Fellowship of the Ring to the slopes of Mount Doom to destroy the One Ring and defeat the Dark Lord Sauron.",
40 "rating": 8.9,
41 "image": "https://m.media-amazon.com/images/M/MV5BMjEyOTU3NzgxOTBeQTJeQWpwZ15BbWUuOTk5OTk3ODg2OTk@.jpg",
42 },
43 {
47 "Batman, Bane, and Catwoman form an alliance to save Gotham City from the clutches of the villainous Lex Luthor and his army of mutated creatures.",
48 "rating": 8.4,
49 "image": "https://m.media-amazon.com/images/M/MV5BMTQ2NTQ5ODUwNTNeQTJeQWpwZ15BbWUuNTU5OTk2NzQ3OTg@.jpg",
50 },
51 {
55 "The true story of Oskar Schindler, a German businessman who saved the lives of over 1,000 Jews during the Holocaust.",
56 "rating": 8.9,
57 "image": "https://m.media-amazon.com/images/M/MV5BMDU0OTg2NDcxNTVeQTJeQWpwZ15BbWUuMjM4MDUwNTQ0OTg@.jpg",
58 },
59 {
63 "A series of interconnected and often violent stories in Los Angeles, told in a non-linear fashion.",
64 "rating": 8.9,
65 "image":
66 "https://m.media-amazon.com/images/M/MV5BMTYwNjAxOTQtNDQ4Mi00NDg3LWE1OWUtODMyYjU4NDZlNzQyXkEyXkFqcGdeQXVyMjMwOTEyMzE0@.jpg",
67 },
68 ],
3This is a lightweight SQLite Admin interface to view and debug your SQLite data.
4
5
6
7It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
3This is a lightweight SQLite Admin interface to view and debug your SQLite data.
4
5
6
7It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
28 return new Response(
29 "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"64\" viewBox=\"218.329 117.251 67.385 67.385\" xml:space=\"preserve\"><path style=\"stroke:#e9d535;stroke-width:0;stroke-dasharray:none;stroke-linecap:butt;stroke-dashoffset:0;stroke-linejoin:miter;stroke-miterlimit:4;fill:#f72f3a;fill-rule:nonzero;opacity:1\" transform=\"translate(218.329 117.25)\" d=\"M33.693 0C52.29 0 67.385 15.094 67.385 33.693c0 18.598-15.094 33.692-33.692 33.692C15.094 67.385 0 52.291 0 33.693 0 15.094 15.094 0 33.693 0Z\"/><path style=\"stroke:none;stroke-width:1;stroke-dasharray:none;stroke-linecap:butt;stroke-dashoffset:0;stroke-linejoin:miter;stroke-miterlimit:4;fill:#fff;fill-rule:nonzero;opacity:1\" transform=\"matrix(.67385 0 0 .67385 225.067 123.99)\" d=\"M63.366 80 40 56.634 16.634 80 0 63.366 23.366 40 0 16.634 16.634 0 40 23.366 63.366 0 80 16.634 56.634 40 80 63.366 63.366 80z\"/></svg>",
30 { headers: { "Content-Type": "image/svg" }, status: 307, statusText: "Currently not available" },
31 );
32 }
1import { fetchNftMetadata } from "https://esm.town/v/jamiedubs/nftMetadata";
2
3export const nftImage = async (req: Request) => {
4 const searchParams = new URL(req.url).searchParams;
5 const contractAddress = searchParams.get("contractAddress");
6 const tokenId = searchParams.get("tokenId");
7 const format = searchParams.get("format")?.toLowerCase() ?? "text";
8 console.log("nftImage", { contractAddress, tokenId });
9 const json = await fetchNftMetadata(contractAddress, tokenId);
10 console.log("nftMetadata response =>", json);
11 const imageUrl = json["metadata"] && json["metadata"]["image"];
12
13 if (format == "json") {
14 return Response.json({ imageUrl });
15 }
16 else if (format == "html") {
17 return new Response(`<img src="${imageUrl}"/>`, {
18 headers: {
19 "Content-Type": "text/html",
22 }
23 else {
24 return new Response(imageUrl, {
25 headers: {
26 "Content-Type": "text/plain",