converter/app/backend/report.go
2025-06-22 22:09:21 -04:00

21 lines
559 B
Go

package backend
import (
"binaryserver/app/db"
"fmt"
"net/http"
)
func ReportHandler(w http.ResponseWriter, req *http.Request) {
handle := req.URL.Query().Get("handle")
records, _ := db.GetRecords(db.QueryOptions{Where: fmt.Sprintf(`handle='%v'`, handle)})
if len(records) > 0 {
if result := instagramHandleExists(records[0].Handle, true); result == "" && records[0].URL != "" {
fmt.Fprintf(w, "Link does seem to be bad. Fixing...\n")
db.DeleteRecord(records[0])
} else {
fmt.Fprintf(w, "Link seems to be active and working!\n")
}
}
}