Replace inconsistent use of username with screen_name
This commit is contained in:
parent
b45aa84b1d
commit
6436cc2e57
8
main.go
8
main.go
|
@ -49,9 +49,9 @@ func probeTwitter(ctx context.Context, target string, registry *prometheus.Regis
|
||||||
}
|
}
|
||||||
|
|
||||||
func twitterHandler(w http.ResponseWriter, r *http.Request) {
|
func twitterHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
username := r.URL.Query().Get("username")
|
screenName := r.URL.Query().Get("screen_name")
|
||||||
if username == "" {
|
if screenName == "" {
|
||||||
http.Error(w, "username parameter is missing", http.StatusBadRequest)
|
http.Error(w, "screen_name parameter is missing", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ func twitterHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx, cancel := context.WithTimeout(r.Context(), time.Duration(5*time.Second))
|
ctx, cancel := context.WithTimeout(r.Context(), time.Duration(5*time.Second))
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
if success := probeTwitter(ctx, username, reg); !success {
|
if success := probeTwitter(ctx, screenName, reg); !success {
|
||||||
log.Error("Probe failed!")
|
log.Error("Probe failed!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue