Use GraphQL API with timeline v2

Close #85
Close #82
Close #77
Close #76
This commit is contained in:
Alexander Sheiko 2023-06-01 23:20:11 +03:00
parent c07bd1d1d4
commit 50440667ed
7 changed files with 502 additions and 131 deletions

View file

@ -2,6 +2,7 @@ package twitterscraper
import (
"context"
"encoding/json"
"net/http"
"net/url"
"regexp"
@ -186,6 +187,14 @@ func parseProfile(user legacyUser) Profile {
return profile
}
func mapToJSONString(data map[string]interface{}) string {
jsonBytes, err := json.Marshal(data)
if err != nil {
return ""
}
return string(jsonBytes)
}
func stringInSlice(a string, list []string) bool {
for _, b := range list {
if b == a {