1export function myApi(name) {
2 return "hi " + name;
3}
3
4export async function getInformationOfTheGitHubReposiroty(repository) {
5 return await fetchJSON(`https://api.github.com/repos/${repository}`, {
6 headers: {
7 Accept: "application/vnd.github+json",
8 Authorization: `Bearer ${process.env.githubToken}`,
9 "X-GitHub-Api-Version": "2022-11-28",
10 },
11 })
2
3export async function coolHnPosts(id) {
4 return fetch("https://hn.algolia.com/api/v1/search_by_date?tags=author_" + id)
5 .then((res) => res.json())
6 .then((res) => res.hits[0].comment_text);
1export function myApi(name) {
2 return "yo " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name + "!!";
3}
6 res: express.Response,
7) {
8 let response = await fetch("https://api.onepeloton.com/auth/login", {
9 method: "POST",
10 mode: "no-cors",
21 const session = await response.json();
22 let workoutResponse = await fetch(
23 `https://api.onepeloton.com/api/user/${session["user_id"]}/workouts`,
24 {
25 method: "GET",
1export function myApi(name) {
2 return "hi " + name;
3}
3// Activity suggestions for when you're bored
4export let boredActivities = fetchJSON(
5 "https://www.boredapi.com/api/activity",
6);
2
3// Currently broken! Val.Town cannot fetch from .gov sites
4// You can get these input values by calling https://api.weather.gov/points/{latitude},{longitude}
5export async function getWeatherGovData({ office, gridX, gridY }) {
6 const data = await fetchJSON(
7 `https://api.weather.gov/gridpoints/${office}/${gridX},${gridY}/forecast`
8 );
9 return data.properties;