Some experiments with web applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
789 B

  1. #!/usr/bin/python
  2. # -*- coding: iso-8859-1 -*-
  3. import cgi
  4. import urllib
  5. import urllib2
  6. # get cgi object
  7. form = cgi.FieldStorage()
  8. ort = ""
  9. hst = ""
  10. vz = ""
  11. vm = ""
  12. timestamp = ""
  13. # check for queries
  14. if (form.getvalue('ort')):
  15. ort = form.getvalue('ort')
  16. if (form.getvalue('hst')):
  17. hst = form.getvalue('hst')
  18. if (form.getvalue('vz')):
  19. vz = form.getvalue('vz')
  20. if (form.getvalue('vz')):
  21. vm = form.getvalue('vz')
  22. if (form.getvalue('timestamp')):
  23. timestamp = form.getvalue('timestamp')
  24. queries = {
  25. "ort": ort,
  26. "hst": hst,
  27. "vz": vz,
  28. "vm": vm,
  29. "timestamp": timestamp
  30. }
  31. url = "http://widgets.vvo-online.de/abfahrtsmonitor/Abfahrten.do?" + urllib.urlencode(queries)
  32. data = urllib2.urlopen(url).read()
  33. print("Content-type: text/html\n\n")
  34. print(data)