Update medium_client.go

This commit is contained in:
mycodedoesnotcompile2 2025-12-13 12:22:43 +00:00 committed by GitHub
parent 6c0f2a15c9
commit f3beb86ec1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,7 +31,7 @@ func PostData(postId string) (*entities.MediumResponse, error) {
}
// http client to post data
url := "https://medium.com/_/graphql"
urlreq := "https://medium.com/_/graphql"
method := "POST"
payload := strings.NewReader(fmt.Sprintf("{\"query\":\"query {\\n post(id: \\\"%s\\\") {\\n title\\n createdAt\\n creator {\\n id\\n name\\n }\\n content {\\n bodyModel {\\n paragraphs {\\n name\\n text\\n type\\n href\\n layout\\n markups {\\n title\\n type\\n href\\n userId\\n start\\n end\\n anchorType\\n }\\n iframe {\\n mediaResource {\\n href\\n iframeSrc\\n iframeWidth\\n iframeHeight\\n }\\n }\\n metadata {\\n id\\n originalWidth\\n originalHeight\\n }\\n }\\n }\\n }\\n }\\n }\",\"variables\":{}}", postId))
@ -51,7 +51,7 @@ func PostData(postId string) (*entities.MediumResponse, error) {
log.Printf("Using proxy: %s", config.Conf.Proxy)
}
req, err := http.NewRequest(method, url, payload)
req, err := http.NewRequest(method, urlreq, payload)
if err != nil {
log.Printf("Error constructing request %v\n", err)
return nil, err