diff --git a/data.json b/data.json index b4bc112..7a28418 100644 --- a/data.json +++ b/data.json @@ -1,3 +1,6 @@ { - "job": "none" + "job": "none", + "emails": [ + "zipfriis@gmail.com" + ] } \ No newline at end of file diff --git a/main.go b/main.go index 82de1c1..ffa93a5 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,8 @@ import ( ) type Config struct { - Job string `json:"job"` + Job string `json:"job"` + Emails []string `json:"emails"` } func loadConfig() (*Config, error) { @@ -24,6 +25,14 @@ func loadConfig() (*Config, error) { return &c, json.Unmarshal(data, &c) } +func saveConfig(c *Config) error { + data, err := json.MarshalIndent(c, "", " ") + if err != nil { + return err + } + return os.WriteFile("data.json", data, 0644) +} + // ---------- Main ---------- func main() { @@ -49,19 +58,29 @@ func main() { http.HandleFunc("GET /favicon.ico", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "./static/icon.png") }) http.HandleFunc("GET /login", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "./static/login.html") }) - http.HandleFunc("POST /login", func(w http.ResponseWriter, r *http.Request) { - r.ParseForm() - - password := r.FormValue("password") - totp := r.FormValue("totp") - - if os.Getenv("password") == password && os.Getenv("auth") == totp { - fmt.Fprintf(w, "logged in") - http.Redirect(w, r, "/admin", http.StatusAccepted) - } else { - w.WriteHeader(http.StatusAccepted) - fmt.Fprintf(w, "password or auth is wrong") + http.HandleFunc("POST /newsletter/subscribe", func(w http.ResponseWriter, r *http.Request) { + var req struct { + Email string `json:"email"` } + + err := json.NewDecoder(r.Body).Decode(&req) + if err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + double := false + + conf, err := loadConfig() + for _, e := range conf.Emails { + if e == req.Email { + double = true + } + } + if !double { + conf.Emails = append(conf.Emails, req.Email) + } + saveConfig(conf) }) http.HandleFunc("GET /status", func(w http.ResponseWriter, r *http.Request) { diff --git a/site b/site index 63632bc..09dc218 100755 Binary files a/site and b/site differ diff --git a/static/index.html b/static/index.html index b8df15c..7ee746a 100644 --- a/static/index.html +++ b/static/index.html @@ -271,6 +271,51 @@
+
+ + +
+
+ When the numbers say something worth saying. +
+

+ Not a scheduled publication. Sent when there is a specific, well-reasoned case to make — a mispricing, a narrative the market has wrong, or an implied expectation that doesn't survive contact with the filings. +

+ Fundamental analysis. SEC filings. No macro noise. +

+ +
+
+
// thesis
+

A specific position on a specific company. Long or short. With a reason.

+
+
+
// filings-first
+

10-K, 10-Q, earnings. The numbers, not the press release.

+
+
+ +
+ + +
+

// no schedule. no spam. unsubscribe anytime.

+ +
+
+