daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Sep 26th, 2016 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from cloudant.client import Cloudant
  2. import json
  3.  
  4. username = "<cloudant_username>"
  5. password = "<cloudant_password>"
  6. cloudantURL = "<cloudant_url>"
  7. client = Cloudant(username, password, url=cloudantURL)
  8.  
  9. document_id = '<cloudant_document_id>'
  10.  
  11. def GetNews():
  12.     client.connect()
  13.     my_database = client['newssentiment']
  14.     # document_id
  15.     news = my_database[document_id]
  16.     client.disconnect()
  17.     # json to string
  18.     news = json.dumps(news)
  19.     return news;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top