start.js 875 B

12345678910111213141516171819202122232425262728293031
  1. var searx_data;
  2. var answer = [];
  3. var temp;
  4. fetch('https://searx.space/data/instances.json')
  5. .then(response => response.json())
  6. .then(function(response) {
  7. searx_data = response.instances;
  8. for (var key in searx_data) {
  9. if searx_data[key]['http']['grade']=='A+'
  10. {
  11. if 'tls' in searx_data[key]
  12. {
  13. if searx_data[key]['tls']['grade']=='A+'
  14. {
  15. if 'html' in searx_data[key]
  16. {
  17. temp = searx_data[key]['html']['grade'];
  18. if (temp=='V' || temp=='C')
  19. {
  20. answer.push(key);
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }
  27. temp = Number(Math.random()*(length(answer)))
  28. // set manifest json parameter as answer[temp]
  29. })