diff --git a/README.md b/README.md index 5f68843..d20d95d 100644 --- a/README.md +++ b/README.md @@ -37,21 +37,20 @@ tl;dr 4get is the best way to browse for shit. | Brave | Yandex | Vimeo | Brave | Swisscows | DuckDuckGo | | Yandex | Brave | Sepia Search | Google | | Yandex | | Google | Google | DuckDuckGo | Yahoo! JAPAN | | Google | -| Google API | Google API | Brave | Startpage | | Startpage | -| Google CSE | Google CSE | Yandex | Qwant | | Kagi | -| Yahoo! JAPAN | Yahoo! JAPAN | Google | Mojeek | | Qwant | -| Startpage | Startpage | Yahoo! JAPAN | Baidu | | Ghostery | -| Qwant | Qwant | Startpage | | | Yep | -| Ghostery | Baidu | Qwant | | | Marginalia | -| Yep | Solofield | Baidu | | | YouTube | -| Mwmbl | Pinterest | Coc Coc | | | SoundCloud | -| Mojeek | Cara | Solofield | | | | -| Baidu | Flickr | | | | | -| Coc Coc | Pexels | | | | | +| Google API | Google API | Brave | Startpage | | Qwant | +| Google CSE | Google CSE | Yandex | Baidu | | Marginalia | +| Yahoo! JAPAN | Yahoo! JAPAN | Google | | | YouTube | +| Startpage | Startpage | Yahoo! JAPAN | | | SoundCloud | +| Yep | Naver | Startpage | | | Startpage | +| Mwmbl | Baidu | Naver | | | Kagi | +| Mojeek | Solofield | Baidu | | | | +| Naver | Pinterest | Cốc Cốc | | | | +| Baidu | Flickr | Purili | | | | +| Cốc Cốc | Pexels | Solofield | | | | | Solofield | Pixabay | | | | | | Marginalia | Unsplash | | | | | -| wiby | 500px | | | | | -| | VSCO | | | | | +| Purili | 500px | | | | | +| wiby | VSCO | | | | | | | Imgur | | | | | | | FindThatMeme | | | | | diff --git a/api/v1/ac.php b/api/v1/ac.php index 50d3095..c61f1ef 100644 --- a/api/v1/ac.php +++ b/api/v1/ac.php @@ -15,13 +15,11 @@ class autocomplete{ "yandex" => "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&uil=en&v=3&sn=5&lr=21276&yu=4861394161661655015", "google" => "https://www.google.com/complete/search?client=mobile-gws-lite&q={searchTerms}", "qwant" => "https://api.qwant.com/v3/suggest/?q={searchTerms}&client=opensearch", - "yep" => "https://api.yep.com/ac/?query={searchTerms}", "marginalia" => "https://search.marginalia.nu/suggest/?partial={searchTerms}", "yt" => "https://suggestqueries-clients6.youtube.com/complete/search?client=youtube&q={searchTerms}", "sc" => "", "startpage" => "https://www.startpage.com/suggestions?q={searchTerms}&format=opensearch&segment=startpage.defaultffx&lui=english", - "kagi" => "https://kagi.com/api/autosuggest?q={searchTerms}", - "ghostery" => "https://ghosterysearch.com/suggest?q={searchTerms}" + "kagi" => "https://kagi.com/api/autosuggest?q={searchTerms}" ]; /* diff --git a/extra/gen_table.php b/extra/gen_table.php new file mode 100644 index 0000000..2896d26 --- /dev/null +++ b/extra/gen_table.php @@ -0,0 +1,151 @@ + [ + "DuckDuckGo", + "Brave", + "Yandex", + "Google", + "Google API", + "Google CSE", + "Yahoo! JAPAN", + "Startpage", + "Yep", + "Mwmbl", + "Mojeek", + "Naver", + "Baidu", + "Cốc Cốc", + "Solofield", + "Marginalia", + "Purili", + "wiby" + ], + "images" => [ + "DuckDuckGo", + "Yandex", + "Brave", + "Google", + "Google API", + "Google CSE", + "Yahoo! JAPAN", + "Startpage", + "Naver", + "Baidu", + "Solofield", + "Pinterest", + "Flickr", + "Pexels", + "Pixabay", + "Unsplash", + "500px", + "VSCO", + "Imgur", + "FindThatMeme" + ], + "videos" => [ + "YouTube", + "Vimeo", + "Sepia Search", + "DuckDuckGo", + "Brave", + "Yandex", + "Google", + "Yahoo! JAPAN", + "Startpage", + "Naver", + "Baidu", + "Cốc Cốc", + "Purili", + "Solofield" + ], + "news" => [ + "DuckDuckGo", + "Brave", + "Google", + "Yahoo! JAPAN", + "Startpage", + "Baidu" + ], + "music" => [ + "SoundCloud", + "Swisscows" + ], + "autocomplete" => [ + "Brave", + "DuckDuckGo", + "Yandex", + "Google", + "Qwant", + "Marginalia", + "YouTube", + "SoundCloud", + "Startpage", + "Kagi" + ] +]; + +$lines = [ + 0 => "", + 1 => "" +]; + +// get longest scraper string +// also get list of scrapers with most entries +$biggest_category_len = 0; +foreach($scrapers as $category_name => $category){ + + $count = count($category); + + if($count > $biggest_category_len){ + + $biggest_category_len = $count; + } +} + +foreach($scrapers as $category_name => $category){ + + // get longest string of the category + $longest_len = mb_strlen($category_name); + foreach($category as $scraper){ + + $strlen = mb_strlen($scraper); + + if($strlen > $longest_len){ + + $longest_len = $strlen; + } + } + + // add header + $lines[0] .= mb_str_pad("| {$category_name}", $longest_len + 3); + $lines[1] .= "|" . str_repeat("-", $longest_len + 2); + + for($i=2; $i