Created
September 9, 2015 14:27
-
-
Save thedore17/2531a4a8a49135eec70a to your computer and use it in GitHub Desktop.
Function to pick link for trove
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
def trove_link(link_url, comment=None): | |
logging.debug('Sending link to Trove') | |
#Setup the https headers and payload data | |
headers = {'Trove-Authorization': TROVE_TOKEN} | |
payload = {"url": link_url, "key": TROVE_API_KEY, "display_text": comment} | |
response = requests.post(TROVE_PICK_URL, params=payload, headers=headers) | |
#Just printing the return for debugging purposes here. | |
logging.debug('Trove HTTP Response: '+str(response.status_code)+', Message: '+response.reason) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment