4
5PoV: You just hacked together a portfolio website or launched a blog as a static website. *Some people who visit might be interested in hearing more from you.* ❤️
6But you don't want to get lost building your backend, API, DB or fancy apps like SubstandardStack or MailMachineGun for people to sign up to your newsletter. 😩
7
8**All you want is a simple input box on your website - when someone types their `email`, `username` or `social link` in and submits it, you want to be notified.**
49
50 const response = await pushover({
51 token: Deno.env.get("PO_API_TOKEN")!,
52 user: Deno.env.get("PO_USER_KEY")!,
53 title,
58 console.log("Notified: ", response);
59 } catch (err) {
60 console.error("Error scraping newsletter ", err);
61 }
62};
18- *scraper* Goes to bytes.dev and scrapes latest published newsletter
19- *inserter* Insert it to SQLite if this newsletter already not exists
20- *notifier* Uses Pushover API to send ios mobile notifications
21
22### Pushover notifications
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12
1// Login into the Notehub API with a programmatic access client ID and client secret
2// Returns the api token to be used for subsequent requests
3const authenticate = async (): Promise<string> => {
4 const body = new URLSearchParams();
23 const token = await authenticate();
24 const res = await fetch(
25 `https://api.notefile.net/v1/projects/${projectUID}/devices/${deviceUID}/notes/${fileName}`,
26 {
27 method: "POST",
34 );
35 if (res.ok) return true;
36 throw new Error("Failed to push note to Notehub API");
37 } catch (e) {
38 console.log(e);
1Migrated from folder: webmention/microformat/key_value_api
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12
8
91. Click `Fork`
102. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via [nominatim's geocoder API](https://www.val.town/v/stevekrouse/nominatimSearch).
113. Click `Run`
12
1# Notehub
2
3A set of helper functions for interacting with the Notehub API
4
5Requires `NOTEHUB_CLIENT_ID` and `NOTEHUB_CLIENT_SECRET` [environment variables](https://www.val.town/settings/environment-variables) to be configured.
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,