[GH-ISSUE #455] [FEATURE] scribe.rip alternative to medium.com #298

Closed
opened 2026-02-25 20:35:21 +03:00 by kerem · 8 comments
Owner

Originally created by @benbusby on GitHub (Oct 12, 2021).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/455

Describe the feature you'd like to see added
Allow scribe.rip to replace all medium.com and *.medium.com results

Additional context
Should function the same as twitter.com -> nitter.net, instagram.com -> bibliogram.art/u, etc, but with the exception that it needs to replace the full domain (including subdomain) for every matching result, not just the medium.com portion.

Originally created by @benbusby on GitHub (Oct 12, 2021). Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/455 <!-- DO NOT REQUEST UI/THEME/GUI/APPEARANCE IMPROVEMENTS HERE THESE SHOULD GO IN ISSUE #60 REQUESTING A NEW FEATURE SHOULD BE STRICTLY RELATED TO NEW FUNCTIONALITY --> **Describe the feature you'd like to see added** Allow [scribe.rip](https://scribe.rip) to replace all `medium.com` and `*.medium.com` results **Additional context** Should function the same as `twitter.com` -> `nitter.net`, `instagram.com` -> `bibliogram.art/u`, etc, but with the exception that it needs to replace the full domain (including subdomain) for every matching result, not just the `medium.com` portion.
kerem 2026-02-25 20:35:21 +03:00
Author
Owner

@benbusby commented on GitHub (Oct 12, 2021):

Anyone interested contributing for hacktoberfest (or otherwise just wanting to contribute) -- this should be a pretty easy issue to tackle that adds a lot of value.

The main things to do would be:

  • Switch the behavior of app/utils/results.py -> get_site_alt() to use urlparse(...).hostname to replace the domain path (rather than just doing a simple hardcoded string replacement) in order to encapsulate subdomains as well.
  • Add config settings for setting/replacing the scribe.rip resource to use for replacing Medium links. It'd need to include a WHOOGLE_ALT_MD env var, or something similar.

If interested, please assign yourself this issue to mark that it's in progress and open a PR once it's finished. Otherwise I'll likely end up tackling this fairly soon (as I often get frustrated with the Medium paywalls).

<!-- gh-comment-id:941347553 --> @benbusby commented on GitHub (Oct 12, 2021): Anyone interested contributing for hacktoberfest (or otherwise just wanting to contribute) -- this should be a pretty easy issue to tackle that adds a lot of value. The main things to do would be: - Switch the behavior of `app/utils/results.py -> get_site_alt()` to use `urlparse(...).hostname` to replace the domain path (rather than just doing a simple hardcoded string replacement) in order to encapsulate subdomains as well. - Add config settings for setting/replacing the scribe.rip resource to use for replacing Medium links. It'd need to include a `WHOOGLE_ALT_MD` env var, or something similar. If interested, please assign yourself this issue to mark that it's in progress and open a PR once it's finished. Otherwise I'll likely end up tackling this fairly soon (as I often get frustrated with the Medium paywalls).
Author
Owner

@vacom13 commented on GitHub (Oct 13, 2021):

I am interested in contributing. Could you guide me as I am fairly new to all this?

<!-- gh-comment-id:941935905 --> @vacom13 commented on GitHub (Oct 13, 2021): I am interested in contributing. Could you guide me as I am fairly new to all this?
Author
Owner

@benbusby commented on GitHub (Oct 14, 2021):

@vacom13 New to the project itself? Or new to contributing on github?

Either way, this feature would involve these changes:

Updating the get_site_alt() method in app/utils/results.py with something like the following:

for site_key in SITE_ALTS.keys():
  if site_key not in link:
      continue
  
  # Need to replace full hostname with alternative to encapsulate
  # subdomains as well
  hostname = urlparse.urlparse(link).hostname
  
  link = link.replace(hostname, SITE_ALTS[site_key])
  for prefix in SKIP_PREFIX:
      link = link.replace(prefix, '//')
  break

return link

Haven't tested that, but should work. Then updating the SITE_ALTS mapping in the same class to include a medium.com that maps to a WHOOGLE_ALT_MD environment variable or something like that with a default value of scribe.rip.

You'd also need to update the documentation in the README with the new environment variable name and purpose, and include it in whoogle.env, the Dockerfile, app.json, and docker-compose.yml. It sounds like a lot but it's all pretty quick copy/paste stuff based on existing environment variables that you can reference like WHOOGLE_ALT_TW and WHOOGLE_ALT_IG.

Let me know if this makes sense. Happy to help further if needed!

<!-- gh-comment-id:942883120 --> @benbusby commented on GitHub (Oct 14, 2021): @vacom13 New to the project itself? Or new to contributing on github? Either way, this feature would involve these changes: Updating the `get_site_alt()` method in `app/utils/results.py` with something like the following: ```python for site_key in SITE_ALTS.keys(): if site_key not in link: continue # Need to replace full hostname with alternative to encapsulate # subdomains as well hostname = urlparse.urlparse(link).hostname link = link.replace(hostname, SITE_ALTS[site_key]) for prefix in SKIP_PREFIX: link = link.replace(prefix, '//') break return link ``` Haven't tested that, but should work. Then updating the `SITE_ALTS` mapping in the same class to include a `medium.com` that maps to a `WHOOGLE_ALT_MD` environment variable or something like that with a default value of `scribe.rip`. You'd also need to update the documentation in the README with the new environment variable name and purpose, and include it in `whoogle.env`, the Dockerfile, `app.json`, and `docker-compose.yml`. It sounds like a lot but it's all pretty quick copy/paste stuff based on existing environment variables that you can reference like `WHOOGLE_ALT_TW` and `WHOOGLE_ALT_IG`. Let me know if this makes sense. Happy to help further if needed!
Author
Owner

@vacom13 commented on GitHub (Oct 14, 2021):

Well I am new to github. Just came across this rep. Felt maybe should try to contribute to it. Thank you. I will work on it!

<!-- gh-comment-id:943179376 --> @vacom13 commented on GitHub (Oct 14, 2021): Well I am new to github. Just came across this rep. Felt maybe should try to contribute to it. Thank you. I will work on it!
Author
Owner

@vacom13 commented on GitHub (Oct 15, 2021):

Hey @benbusby. I created a PR. Would love to contribute more. Tell me if there is anything more that I could do. I want to help and learn along the way.

<!-- gh-comment-id:944220328 --> @vacom13 commented on GitHub (Oct 15, 2021): Hey @benbusby. I created a PR. Would love to contribute more. Tell me if there is anything more that I could do. I want to help and learn along the way.
Author
Owner

@benbusby commented on GitHub (Oct 15, 2021):

Awesome. I'll review the PR this weekend and let you know if there's anything else needed. Thanks for taking care of this!

<!-- gh-comment-id:944427797 --> @benbusby commented on GitHub (Oct 15, 2021): Awesome. I'll review the PR this weekend and let you know if there's anything else needed. Thanks for taking care of this!
Author
Owner

@benbusby commented on GitHub (Oct 16, 2021):

Merged via #463 -- thanks again @vacom13, great work.

I'm slowly trying to mark the more straightforward issues with the label "good first issue". Keep an eye out for those and let me know if you want to contribute to any that you see.

<!-- gh-comment-id:944975546 --> @benbusby commented on GitHub (Oct 16, 2021): Merged via #463 -- thanks again @vacom13, great work. I'm slowly trying to mark the more straightforward issues with the label "good first issue". Keep an eye out for those and let me know if you want to contribute to any that you see.
Author
Owner

@vacom13 commented on GitHub (Oct 16, 2021):

@benbusby Sure thing!

<!-- gh-comment-id:944976578 --> @vacom13 commented on GitHub (Oct 16, 2021): @benbusby Sure thing!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whoogle-search#298
No description provided.