diff --git a/database.go b/database.go index e398a22..8c9696b 100644 --- a/database.go +++ b/database.go @@ -1121,7 +1121,7 @@ func cleanupdb(arg string) { if err != nil { elog.Fatal(err) } - for xid, _ := range filexids { + for xid := range filexids { _, err = tx.Exec("delete from filedata where xid = ?", xid) if err != nil { elog.Fatal(err) diff --git a/import.go b/import.go index 8ac5c34..7dfbe6e 100644 --- a/import.go +++ b/import.go @@ -338,7 +338,7 @@ func importTwitter(username, source string) { } var tweets []*Tweet - fd, err := os.Open(source + "/tweet.js") + fd, err := os.Open(source + "/tweets.js") if err != nil { elog.Fatal(err) } @@ -375,11 +375,6 @@ func importTwitter(username, source string) { continue } - if t.Tweet.FavoriteCount == "0" || t.Tweet.FavoriteCount == "" { - log.Printf("skipping, unworthy tweet") - continue - } - what := "honk" noise := "" if parent := tweetmap[t.Tweet.InReplyToStatusID]; parent != nil { diff --git a/web.go b/web.go index c7507cc..2249f9a 100644 --- a/web.go +++ b/web.go @@ -602,7 +602,7 @@ func xzone(w http.ResponseWriter, r *http.Request) { honkers = append(honkers, Honker{XID: xid}) } rows.Close() - for i, _ := range honkers { + for i := range honkers { _, honkers[i].Handle = handles(honkers[i].XID) } templinfo := getInfo(r) @@ -2560,6 +2560,9 @@ func apihandler(w http.ResponseWriter, r *http.Request) { } func fiveoh(w http.ResponseWriter, r *http.Request) { + if !develMode { + return + } fd, err := os.OpenFile("violations.json", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) if err != nil { elog.Printf("error opening violations! %s", err) @@ -2606,7 +2609,11 @@ func bgmonitor() { func addcspheaders(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Security-Policy", "default-src 'none'; script-src 'self'; connect-src 'self'; style-src 'self'; img-src 'self'; media-src 'self'; report-uri /csp-violation") + policy := "default-src 'none'; script-src 'self'; connect-src 'self'; style-src 'self'; img-src 'self'; media-src 'self'" + if develMode { + policy += "; report-uri /csp-violation" + } + w.Header().Set("Content-Security-Policy", policy) next.ServeHTTP(w, r) }) }