diff --git a/README.md b/README.md index 8522da8..94a81c5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Whoogle Search](docs/banner.png) +![Whoogle Search](https://raw.githubusercontent.com/benbusby/whoogle-search/main/docs/banner.png) [![Latest Release](https://img.shields.io/github/v/release/benbusby/whoogle-search)](https://github.com/benbusby/shoogle/releases) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) @@ -39,9 +39,9 @@ Contents ## Features - No ads or sponsored content -- No JavaScript -- No cookies -- No tracking/linking of your personal IP address\* +- No JavaScript\* +- No cookies\*\* +- No tracking/linking of your personal IP address\*\*\* - No AMP links - No URL tracking tags (i.e. utm=%s) - No referrer header @@ -49,14 +49,18 @@ Contents - Autocomplete/search suggestions - POST request search and suggestion queries (when possible) - View images at full res without site redirect (currently mobile only) -- Dark mode +- Light/Dark/System theme modes (with support for [custom CSS theming](https://github.com/benbusby/whoogle-search/wiki/User-Contributed-CSS-Themes)) - Randomly generated User Agent - Easy to install/deploy - DDG-style bang (i.e. `! `) searches - Optional location-based searching (i.e. results near \) -- Optional NoJS mode to disable all Javascript in results +- Optional NoJS mode to view search results in a separate window with JavaScript blocked -*If deployed to a remote server, or configured to send requests through a VPN, Tor, proxy, etc. +*No third party JavaScript. Whoogle can be used with JavaScript disabled, but if enabled, uses JavaScript for things like presenting search suggestions. + +**No third party cookies. Whoogle uses server side cookies (sessions) to store non-sensitive configuration settings such as theme, language, etc. Just like with JavaScript, cookies can be disabled and not affect Whoogle's search functionality. + +***If deployed to a remote server, or configured to send requests through a VPN, Tor, proxy, etc. ## Dependencies If using Heroku Quick Deploy, **you can skip this section**. @@ -501,7 +505,7 @@ A lot of the app currently piggybacks on Google's existing support for fetching ## Screenshots #### Desktop -![Whoogle Desktop](docs/screenshot_desktop.jpg) +![Whoogle Desktop](https://raw.githubusercontent.com/benbusby/whoogle-search/main/docs/screenshot_desktop.jpg) #### Mobile -![Whoogle Mobile](docs/screenshot_mobile.jpg) +![Whoogle Mobile](https://raw.githubusercontent.com/benbusby/whoogle-search/main/docs/screenshot_mobile.jpg) diff --git a/app/filter.py b/app/filter.py index 97d52db..8f241e5 100644 --- a/app/filter.py +++ b/app/filter.py @@ -331,8 +331,15 @@ class Filter: if len(link_desc) == 0: return - # Replace link destination - link_desc[0].replace_with(get_site_alt(link_desc[0])) + # Replace link description + link_desc = link_desc[0] + for site, alt in SITE_ALTS.items(): + if site not in link_desc: + continue + new_desc = BeautifulSoup(features='html.parser').new_tag('div') + new_desc.string = str(link_desc).replace(site, alt) + link_desc.replace_with(new_desc) + break def view_image(self, soup) -> BeautifulSoup: """Replaces the soup with a new one that handles mobile results and diff --git a/app/models/config.py b/app/models/config.py index fb5be7a..bb10d12 100644 --- a/app/models/config.py +++ b/app/models/config.py @@ -28,6 +28,7 @@ class Config: self.new_tab = read_config_bool('WHOOGLE_CONFIG_NEW_TAB') self.view_image = read_config_bool('WHOOGLE_CONFIG_VIEW_IMAGE') self.get_only = read_config_bool('WHOOGLE_CONFIG_GET_ONLY') + self.accept_language = False self.safe_keys = [ 'lang_search', diff --git a/app/request.py b/app/request.py index 68e30d8..9bb9bd0 100644 --- a/app/request.py +++ b/app/request.py @@ -157,6 +157,12 @@ class Request: self.language = ( config.lang_search if config.lang_search else '' ) + + # For setting Accept-language Header + self.lang_interface = '' + if config.accept_language: + self.lang_interface = config.lang_interface + self.mobile = bool(normal_ua) and ('Android' in normal_ua or 'iPhone' in normal_ua) self.modified_user_agent = gen_user_agent(self.mobile) @@ -243,7 +249,12 @@ class Request: 'User-Agent': modified_user_agent } - # FIXME: Should investigate this further to ensure the consent + # Adding the Accept-Language to the Header if possible + if self.lang_interface: + headers.update({'Accept-Language': + self.lang_interface.replace('lang_', '') + + ';q=1.0'}) + # view is suppressed correctly now = datetime.now() cookies = { diff --git a/app/static/css/variables.css b/app/static/css/variables.css index 1a531a0..e53d157 100644 --- a/app/static/css/variables.css +++ b/app/static/css/variables.css @@ -3,7 +3,7 @@ /* LIGHT THEME COLORS */ --whoogle-logo: #685e79; --whoogle-page-bg: #ffffff; - --whoogle-element-bg: #685e79; + --whoogle-element-bg: #4285f4; --whoogle-text: #000000; --whoogle-contrast-text: #ffffff; --whoogle-secondary-text: #70757a; @@ -11,18 +11,44 @@ --whoogle-result-title: #1967d2; --whoogle-result-url: #0d652d; --whoogle-result-visited: #4b11a8; - --whoogle-divider: #dfe1e5; /* DARK THEME COLORS */ - --whoogle-dark-logo: #888888; - --whoogle-dark-page-bg: #080808; - --whoogle-dark-element-bg: #111111; - --whoogle-dark-text: #dddddd; - --whoogle-dark-contrast-text: #aaaaaa; - --whoogle-dark-secondary-text: #8a8b8c; - --whoogle-dark-result-bg: #111111; - --whoogle-dark-result-title: #dddddd; - --whoogle-dark-result-url: #eceff4; - --whoogle-dark-result-visited: #959595; - --whoogle-dark-divider: #111111; + --whoogle-dark-logo: #685e79; + --whoogle-dark-page-bg: #101020; + --whoogle-dark-element-bg: #4285f4; + --whoogle-dark-text: #ffffff; + --whoogle-dark-contrast-text: #ffffff; + --whoogle-dark-secondary-text: #bbbbbb; + --whoogle-dark-result-bg: #212131; + --whoogle-dark-result-title: #64a7f6; + --whoogle-dark-result-url: #34a853; + --whoogle-dark-result-visited: #bbbbff; +} + +#whoogle-w { + fill: #4285f4; +} + +#whoogle-h { + fill: #ea4335; +} + +#whoogle-o-1 { + fill: #fbbc05; +} + +#whoogle-o-2 { + fill: #4285f4; +} + +#whoogle-g { + fill: #34a853; +} + +#whoogle-l { + fill: #ea4335; +} + +#whoogle-e { + fill: #fbbc05; } diff --git a/app/templates/index.html b/app/templates/index.html index 435dcf3..27b1f1b 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -177,6 +177,10 @@
+
+
+ +
diff --git a/app/utils/results.py b/app/utils/results.py index a199427..8141074 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -27,7 +27,10 @@ SITE_ALTS = { 'youtube.com': os.getenv('WHOOGLE_ALT_YT', 'invidious.snopyta.org'), 'instagram.com': os.getenv('WHOOGLE_ALT_IG', 'bibliogram.art/u'), 'reddit.com': os.getenv('WHOOGLE_ALT_RD', 'libredd.it'), - 'medium.com': os.getenv('WHOOGLE_ALT_MD', 'scribe.rip'), + **dict.fromkeys([ + 'medium.com', + 'levelup.gitconnected.com' + ], os.getenv('WHOOGLE_ALT_MD', 'scribe.rip')) }