diff options
| author | Ben Busby <contact@benbusby.com> | 2024-01-08 12:07:38 -0700 |
|---|---|---|
| committer | Ben Busby <contact@benbusby.com> | 2024-01-08 12:07:38 -0700 |
| commit | 99b13b3aa6277f331e85e20cac7aed43a3c284fb (patch) | |
| tree | c1a4fe7a6d5446a0ddead74e9c53fb977f56fa59 /lib | |
| parent | 7f26ab3bbf3743e5f6924b51e08986b58641ba49 (diff) | |
| download | farside-99b13b3aa6277f331e85e20cac7aed43a3c284fb.tar.gz | |
Replace bibliogram w/ proxigram
Closes #149
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/farside.ex | 22 | ||||
| -rw-r--r-- | lib/farside/router.ex | 1 |
2 files changed, 2 insertions, 21 deletions
diff --git a/lib/farside.ex b/lib/farside.ex index fa74a80..d2398d5 100644 --- a/lib/farside.ex +++ b/lib/farside.ex @@ -8,7 +8,7 @@ defmodule Farside do # farside.link/https://www.youtube.com/watch?v=dQw4w9WgXcQ @youtube_regex ~r/youtu(.be|be.com)|invidious|piped/ @reddit_regex ~r/reddit.com|libreddit|redlib/ - @instagram_regex ~r/instagram.com|bibliogram/ + @instagram_regex ~r/instagram.com|proxigram/ @twitter_regex ~r/twitter.com|nitter/ @wikipedia_regex ~r/wikipedia.org|wikiless/ @medium_regex ~r/medium.com|scribe/ @@ -23,7 +23,7 @@ defmodule Farside do @parent_services %{ @youtube_regex => ["invidious", "piped"], @reddit_regex => ["libreddit", "redlib"], - @instagram_regex => ["bibliogram"], + @instagram_regex => ["proxigram"], @twitter_regex => ["nitter"], @wikipedia_regex => ["wikiless"], @medium_regex => ["scribe"], @@ -114,24 +114,6 @@ defmodule Farside do instance end - def amend_instance(instance, service, path) do - cond do - String.match?(service, @instagram_regex) -> - # Bibliogram doesn't have a 1:1 matching to Instagram URLs for users, - # so a "/u" is appended if the requested path doesn't explicitly include - # "/p" for a post or an empty path for the home page. - if String.length(path) > 0 and - !String.starts_with?(path, "p/") and - !String.starts_with?(path, "u/") do - "#{instance}/u" - else - instance - end - true -> - instance - end - end - def get_last_updated do CubDB.get(CubDB, "last_updated") end diff --git a/lib/farside/router.ex b/lib/farside/router.ex index 00d98e2..80fc82f 100644 --- a/lib/farside/router.ex +++ b/lib/farside/router.ex @@ -62,7 +62,6 @@ defmodule Farside.Router do true -> instance = Farside.get_service(service_name) |> Farside.pick_instance - |> Farside.amend_instance(service_name, path) # Redirect to the available instance conn |
