Greasy Fork is available in English.

Wikiloc auto apply filters

Automatically applies the specified filters to the search page on WikiLoc (unless it's the favorite list)

  1. // ==UserScript==
  2. // @name Wikiloc auto apply filters
  3. // @namespace https://github.com/marcodallagatta/userscripts/tree/main/wikiloc-auto-add-filters
  4. // @version 1.0
  5. // @description Automatically applies the specified filters to the search page on WikiLoc (unless it's the favorite list)
  6. // @author You
  7. // @match https://www.wikiloc.com/wikiloc/map.do?*
  8. // @icon https://icons.duckduckgo.com/ip2/wikiloc.com.ico
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. if (window.location.toString().includes('favoriteList')) return;
  16.  
  17. const minLength = '3'; // in km, '0' for all
  18. const maxLength = '20'; // in km
  19. const elevMin = '200';
  20. const elevMax = '1250';
  21. const loop = '1'; // 0 not loop, 1 loop
  22.  
  23. if (!window.location.toString().includes('uto')) { // checks if it contains max elevation
  24. window.location += `&act=1%2C43&lfr=${minLength}&lto=${maxLength}&ufr=${elevMin}&uto=${elevMax}&sto=3&loop=${loop}`;
  25. }
  26. })();