Share
Explore

Link preview

Add
Lien
1
Tiramisu aux framboises
sucre roux, sucre vanillé, biscuits à la cuillère, lait, oeuf, mascarpone, framboises
Link
Canicule : 3 recettes sans cuisson idéales pour résister aux grosses chaleurs
Avec les températures actuelles, on a envie d’une seule chose : de fraîcheur dans nos assiettes. L’astuce idéale, préparer des recettes sans cuisson…
Link
Coda on Twitter
Sometimes evolution is slow. Other times, it takes a giant leap. Welcome to a world where chickens have arms and dogs have propellers: #EverythingEvolves
Link
Table view
1
Image
Title
Description
Button
Rating
Add note
Link
1
Tiramisu aux framboises
sucre roux, sucre vanillé, biscuits à la cuillère, lait, oeuf, mascarpone, framboises
Link
Open
2
Canicule : 3 recettes sans cuisson idéales pour résister aux grosses chaleurs
Avec les températures actuelles, on a envie d’une seule chose : de fraîcheur dans nos assiettes. L’astuce idéale, préparer des recettes sans cuisson…
Link
Open
3
Coda on Twitter
Sometimes evolution is slow. Other times, it takes a giant leap. Welcome to a world where chickens have arms and dogs have propellers: #EverythingEvolves
Link
Open
There are no rows in this table


DOCUMENTATION
⚠️ To be able to use the pack, you must have an API key.
Need to know
Free for your personal use only
60 max requests per hour (free plan)
Need more ?
Use the Open Graph meta tags
Optimized to work with the following services :
CleanShot 2022-07-19 at 18.16.13@2x.png
This link can't be embedded.
Pack’s code
import * as coda from "@codahq/packs-sdk";
export const pack = coda.newPack();

// Authorize this domain
pack.addNetworkDomain("api.linkpreview.net");

// Ask the API's Key
pack.setUserAuthentication({
type: coda.AuthenticationType.QueryParamToken,
paramName: "key",
instructionsUrl: "https://my.linkpreview.net/",
});

// Define Response Schema
const PreviewSchema = coda.makeObjectSchema({
properties: {
title: { type: coda.ValueType.String },
description: { type: coda.ValueType.String, codaType: coda.ValueHintType.Markdown},
url: { type: coda.ValueType.String, codaType: coda.ValueHintType.Url },
image: { type: coda.ValueType.String, codaType:coda.ValueHintType.ImageReference }
},
displayProperty: "title"
})

// Add column
pack.addColumnFormat({
name: "Preview",
instructions: "Paste the link",
formulaName: "Preview",
});

// Define Formula Name
pack.addFormula({
name: "Preview",
description: "Get basic website information from any given URL",

// Define the paramater
parameters: [
coda.makeParameter({
type: coda.ParameterType.String,
name: "link",
description: "paste the url",
optional: true,
}),
],
resultType: coda.ValueType.Object,
schema: PreviewSchema,
execute: async function (
[name],
context,
) {

//Build "url" for the http's request
let url = "https://api.linkpreview.net/";
url = coda.withQueryParams(url, {
q : name
});

//Let's go, make the request
let response = await context.fetcher.fetch({
method: "GET",
url: url
});
let data = response.body ;
return data
},
});
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.