Skip to content

Instantly share code, notes, and snippets.

@soeffing
Created September 26, 2017 19:39
Show Gist options
  • Save soeffing/0bf791af41d234df46f4afaa213bd8b9 to your computer and use it in GitHub Desktop.
Save soeffing/0bf791af41d234df46f4afaa213bd8b9 to your computer and use it in GitHub Desktop.
from pprint import pprint
import requests
import json
CLF_URL = FILL_IN_ENDPOINT (as string)
# If you put `debug` to 1, you get a bunch of helpful debug info, e.g. the article that was extracted from the URL
# query parameter must be set, otherwise classification will be really off
payloads = [
{'urls': ['https://backlinko.com/seo-techniques'], 'query': 'seo techniques', 'debug': 0},
{'urls': ['https://seo-hacker.com/black-hat-seo-hacker/'], 'query': 'black hat seo', 'debug': 0},
]
for payload in payloads:
r = requests.get(CLF_URL, params=payload)
j_r = json.loads(r.text)
pprint(j_r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment