Created
June 3, 2020 04:19
-
-
Save cjh0613/28427e98e567cc28b31354fe92ce1c6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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