62. Go to the Notion database -> click ••• from top right -> Connections -> Connect to, select the integration from last step
73. Fork this val
84. Set up your NOTION_DATABASE_ID and NOTION_API_TOKEN in: https://www.val.town/settings/environment-variables
95. Update the code to customize with your database properties (look out for "Customize based on your database")
106. Share the RSS url
23 if (!department) return c.text("/:department not provided", 400);
24 const subjects = await fetch(
25 `https://api.amu.ac.in/api/v1/department-list-data?lang=en&slug=department/${department}/under-graduate`,
26 ).then(r => r.json());
27 const subs = subjects.data.data.map(s => omitKeys(["cr", "jp", "peo", "po", "spec", "dr"], s));
1Example of an [Enkaku client](https://enkaku.dev/docs/api/client/) using HTTP.
2
3[Server code Val](https://www.val.town/v/paul_lecam/EnkakuStatefulHTTPExample)
1Example of an [Enkaku server](https://enkaku.dev/docs/api/server/) over HTTP.
2
3[Client code Val](https://www.val.town/v/paul_lecam/EnkakuStatefulHTTPExampleClient)
3The app is set up so you can easily have a conversation between two people. The app will translate between the two selected languages, in each voice, as the speakers talk.
4
5Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.
6
7const app = new Hono();
8const openai = new OpenAI(Deno.env.get("OPENAI_API_KEY_VOICE"));
9
10class TranscriptionService {
19 return transcription;
20 } catch (error) {
21 console.error("OpenAI API error:", error);
22 throw error;
23 }
423 return c.text(translation);
424 } catch (error) {
425 console.error("OpenAI API error:", error);
426 return c.text("Error occurred during translation", 500);
427 }
450 });
451 } catch (error) {
452 console.error("OpenAI API error:", error);
453 return c.text("Error occurred during speech generation", 500);
454 }
3The app is set up so you can easily have a conversation between two people. The app will translate between the two selected languages, in each voice, as the speakers talk.
4
5Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.
5
6const app = new Hono();
7const openai = new OpenAI(Deno.env.get("OPENAI_API_KEY_VOICE"));
8
9class TranscriptionService {
18 return transcription;
19 } catch (error) {
20 console.error('OpenAI API error:', error);
21 throw error;
22 }
368 return c.text(translation);
369 } catch (error) {
370 console.error('OpenAI API error:', error);
371 return c.text('Error occurred during translation', 500);
372 }
395 });
396 } catch (error) {
397 console.error('OpenAI API error:', error);
398 return c.text('Error occurred during speech generation', 500);
399 }
24async function fetchRandomJoke() {
25 const response = await fetch(
26 "https://official-joke-api.appspot.com/random_joke",
27 );
28 return response.json();
77 const normalizedTargetLang = languageMap[target_lang] || target_lang;
78
79 // Perform translations for each text using Google Translate API
80 const translationPromises = text_list.map(async (text) => {
81 try {
82 const translationResponse = await fetch(
83 `https://translate.googleapis.com/translate_a/single?client=gtx&sl=${normalizedSourceLang}&tl=${normalizedTargetLang}&dt=t&q=${encodeURIComponent(text)}`,
84 {
85 method: 'GET',
96 const translationData = await translationResponse.json();
97
98 // Google Translate API returns a nested array structure
99 // First element contains the translation parts
100 const translatedTextParts = translationData[0];