Skip to content

Instantly share code, notes, and snippets.

@thedore17
Created September 9, 2015 14:27
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 thedore17/2531a4a8a49135eec70a to your computer and use it in GitHub Desktop.
Save thedore17/2531a4a8a49135eec70a to your computer and use it in GitHub Desktop.
Function to pick link for trove
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