7For how to use it see this [example val](https://www.val.town/v/saolsen/traced_http_val).
8
9By default, traces log to the console but if you set `HONEYCOMB_API_KEY` it'll also push the traces to honeycomb.
10In the future we can add more export targets for other services. I'm also thinking about making a val to display them.
11
7To use it on your own Val Town Blob Storage, [fork it](https://www.val.town/v/stevekrouse/blob_admin/fork) to your account.
8
9It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
10
11# TODO
7To use it on your own Val Town Blob Storage, [fork it](https://www.val.town/v/stevekrouse/blob_admin/fork) to your account.
8
9It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
10
11# TODO
17}): Promise<TweetResult[]> {
18 const { data } = await twitterJSON({
19 url: `https://api.twitter.com/2/tweets/search/recent?query=${await searchParams(
20 {
21 query,
55 const results = await twitterSearch({
56 query,
57 bearerToken: Deno.env.get("TWITTER_API_KEY"),
58 });
59 console.log("Here!", results);
19
20async function fetchUser(token: string): Promise<User> {
21 const resp = await fetch("https://api.val.town/v1/me", {
22 headers: {
23 Authorization: `Bearer ${token}`,
17```
18
19To authenticate, [paste an api token](https://www.val.town/settings/api) in the password prompt.
20
21Migrated from folder: Archive/basicAuth
6 key: string;
7}) {
8 const apiKey = process.env.sf_tidbyt_api_key;
9 const deviceId = process.env.sf_tidbyt_device_id;
10 const res = await fetch(
11 `https://api.tidbyt.com/v0/devices/${deviceId}/push`,
12 {
13 method: "POST",
14 headers: {
15 Authorization: `Bearer ${apiKey}`,
16 },
17 body: JSON.stringify({
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
1# gsheet_call
2Wrapper around Google Sheets API v4.
3
4## Parameters
6- sheet_id: Google Sheet ID
7- method: HTTP method to use
8- action: Full URL with `https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/` removed
9- data: HTTP request body
10
11## Requirements
12- a Google Cloud service account
13- the Google Sheets API v4 enabled in your Google Cloud project
14- the spreadsheet ID (provide it in the sheet_id parameter)
15
1export async function test() {
2 const { default: axios } = await import("npm:axios");
3 const url = "http://207.244.232.58:8011/api/login";
4 const message = "testing";
5 const loginInfo = {