Advertisement
6jarjar6

Matomy QR Code API Example

Dec 24th, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. #!/usr/bin/env python
  2. #Proof of concept
  3. #http://service.matomy.com/qrcode.jsp?width=115&height=115&text=http://www.google.com/
  4.  
  5. import urllib2
  6. import json
  7. import sys
  8.  
  9. def user_search(query):
  10.     print 'QR Code Test'
  11.     url = 'http://service.matomy.com/qrcode.jsp?'
  12.     width = raw_input("Width: ")
  13.     url = url + 'width=' + width
  14. #http://service.matomy.com/qrcode.jsp?width=115
  15.     height = raw_input("Height: ")
  16.     url = url + '&height=' + height + '&text='
  17. #http://service.matomy.com/qrcode.jsp?width=115&height=115&text=
  18.     text = raw_input("Text: ")
  19.     url = url + text
  20. #http://service.matomy.com/qrcode.jsp?width=115&height=115&text=http://www.google.com/
  21.  
  22.  
  23.  
  24.  
  25.    
  26.  
  27.    
  28.     print url
  29.     temp = urllib2.urlopen(url).geturl()
  30.     print temp
  31.  
  32. user_search("This is to call function with cmd")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement