Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. username = SET_THIS
  4. password = SET_THIS
  5.  
  6. import sys
  7. import fluidinfo
  8.  
  9. notices = []
  10. isbn = ""
  11. page = ""
  12. paragraph = ""
  13. errata = ""
  14. headers = {}
  15. contents = {}
  16. cover_url = ""
  17. data = {}
  18. abouttag = ""
  19. title = ""
  20.  
  21. isbn = 'asdfsdfdasfa'
  22.  
  23. fluidinfo.login(username, password)
  24. print "Logged into %s as %s" % (fluidinfo.instance, username)
  25.  
  26. query = 'oreilly.com/isbn = "%s"' % isbn
  27. print "Query: %s" % query
  28.  
  29. headers, contents = fluidinfo.call('GET', '/values', tags=['fluiddb/about', 'oreilly.com/cover-medium', 'oreilly.com/title'], query=query)
  30. fluidinfo.logout()
  31. print "Status: %s" % headers['status']
  32. for r in contents['results']['id'].values():
  33.     abouttag = r['fluiddb/about']['value']
  34.     cover_url = r['oreilly.com/cover-medium']['value']
  35.     title = r['oreilly.com/title']['value']
  36. print "About: %s" % abouttag
  37. print "URL: %s" % cover_url
  38. print "Title: %s" % title
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement