Skip to content

Instantly share code, notes, and snippets.

@cjh0613
Created June 3, 2020 04:19
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 cjh0613/28427e98e567cc28b31354fe92ce1c6e to your computer and use it in GitHub Desktop.
Save cjh0613/28427e98e567cc28b31354fe92ce1c6e to your computer and use it in GitHub Desktop.
import requests
def get_(data):
headers={'User-Agent':'curl/7.12.1 ',
'Content-Type':'application/json'}
try:
r = requests.post(url='https://ssl.bing.com/webmaster/api.svc/json/SubmitUrl?apikey=API_KEY',json=data)
print(r.status_code)
print(r.content)
except Exception.e:
print(e)
#Example:
cjhpush={
"siteUrl": "https://cjh0613.github.io",
"url": "https://cjh0613.github.io/index.html"
}
print(cjhpush)
get_(cjhpush)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment