defmodule Nola.Plugins.Link.Quirks do # def uri(%URI{host: "x.com"} = uri) do # %URI{uri | host: "vxtwitter.com"} # end # reddit: new reddit don't have titles for pages we don't handle in the reddit module # fallback to old. which has nice titles def uri(%URI{host: reddit} = uri) when reddit in ["www.reddit.com", "reddit.com"] do %URI{uri | host: "old.reddit.com"} end def uri(url) do url end def user_agent(host) when host in [ "x.com", "vxtwitter.com", "fxtwitter.com", "instagram.com", "facebook.com", "xnstagram.com", "ddinstagram.com" ] do "TelegramBot (like TwitterBot)" end def user_agent(_host) do "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36" end end