Use GraphQL API with timeline v2
Close #85 Close #82 Close #77 Close #76
This commit is contained in:
parent
c07bd1d1d4
commit
50440667ed
7 changed files with 502 additions and 131 deletions
9
util.go
9
util.go
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue