PageRenderTime 90ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/example/spice.html

https://github.com/mikeedwards83/zeroclickinfo-spice
HTML | 46 lines | 14 code | 9 blank | 23 comment | 0 complexity | 9e70dd7e9cb805772b5ae81c71781836 MD5 | raw file
  1. <html>
  2. <head>
  3. <!--
  4. This is the function you define -- see its details in the repository.
  5. //-->
  6. <script type="text/javascript" src="example/spice.js"></script>
  7. <!--
  8. This is a stub function that takes what you pass it
  9. and creates the Zero-click Info that gets shoved
  10. into the body of the page in the div marked "a".
  11. //-->
  12. <script type="text/javascript">
  13. function nra(items) {
  14. document.getElementById('a').innerHTML = items[0]['a'];
  15. }
  16. </script>
  17. </head>
  18. <body>
  19. <!--
  20. This is a placeholder div for the Zero-click Info that nra() populates
  21. //-->
  22. <div id="a"></div>
  23. <!--
  24. We call the external script here.
  25. All excternal calls go through our server for security and privacy, e.g.
  26. we strip referer headers so search terms don't leak and we can hide api keys.
  27. We can also change the response so it goes into JSONP format,
  28. which means it calls your function directly.
  29. If the provider already has JSONP you can use it for testing directly.
  30. The /ir/ piece will change for each endpoint, e.g. /ib/ for bitcoin.
  31. //-->
  32. <script type="text/javascript" src="http://duckduckgo.com/ir/Philadelphia"></script>
  33. </body>
  34. </html>