Skip to content

Instantly share code, notes, and snippets.

@CakeCrusher
Created April 2, 2022 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CakeCrusher/2cf982d7575b5059c66181bab46b0478 to your computer and use it in GitHub Desktop.
Save CakeCrusher/2cf982d7575b5059c66181bab46b0478 to your computer and use it in GitHub Desktop.
import requests
import json
url = "https://www.kuoly.com/graphql"
payload="{\"query\":\"mutation CatalogueMacro($catalogue: CatalogueInput!) {\\r\\n catalogueMacro(catalogue: $catalogue)\\r\\n}\",\"variables\":{\"catalogue\":{\"title\":\"Summer 2022 Materials\",\"status\":\"public\",\"description\":\"Be prepared for success with these materialswith these materials!\",\"header_image_url\":\"https://storage.googleapis.com/givespace-pictures/UoF banner1648651124064.png\",\"header_color\":\"#495fb6\",\"author\":\"University of Farmington\",\"profile_picture_url\":\"https://storage.googleapis.com/givespace-pictures/University_of_Farmington_logo1648650654721.png\",\"event_date\":\"2022-06-13\",\"labels\":[{\"name\":\"CHM2414\",\"ordering\":1},{\"name\":\"MTH1105\",\"ordering\":2},{\"name\":\"ENL3045\",\"ordering\":3},{\"name\":\"optional\",\"ordering\":4}],\"listings\":[{\"name\":\"Fahrenheit 451\",\"ordering\":5},{\"name\":\"Calculus: Early Transcendental Functions\",\"link_url\":\"https://www.mheducation.com/highered/product/calculus-smith-minton/M9780073383118.html\",\"ordering\":1,\"links\":[{\"url\":\"https://www.mheducation.com/highered/product/calculus-smith-minton/digital/M9780073383118.html\",\"title\":\"Digital\"},{\"url\":\"https://www.mheducation.com/highered/product/calculus-smith-minton/M9780073383118.html\",\"title\":\"Hardcover\"}],\"labels\":[{\"label_name\":\"MTH1105\"}]},{\"name\":\"Texas Instruments TI-30XIIS Scientific Calculator, Black with Blue Accents\",\"ordering\":2,\"labels\":[{\"label_name\":\"MTH1105\"},{\"label_name\":\"optional\"}]}]}}}"
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment