OS: Windows 10@64
Compiler: Lazarus 3.4
Project: Personal Help notes, data base
I keep a massive data base of links, tip, examples, and anything I deem worthy of noting.
So I have collected some web site links and social post links.
I know that links are not permanent so here is the logic
Test if link is still valid and if so load it into the default browser (Brave)
else link not valid then load the default link "
https://forum.lazarus.freepascal.org/"
So I don't care what or if any errors occur during the testing only does it return as valid.
if any error of any sort then load up default Lazarus which is like 90% of the time anyway.
TRon
Remy Lebeau
Thaddy
jamie
dseligo
I thank you all very sincerely
Here is my code: for testing the links valid
function IsURLValid(const URL: string): Boolean;
var
HTTPClient: TFPHTTPClient;
begin
HTTPClient := TFPHTTPClient.Create(nil);
HTTPClinet.AllowRedirect:= TRUE;
try
try
HTTPClient.SimpleGet(URL); // Try to fetch the page
Result:=TRUE;
except
on E: Exception do
Result := False; // If any exception occurs, consider the site as invalid
end;
finally
HTTPClient.Free;
end;
end;
I do not know why some links work while other don't. However all links work if just copy and paste into browser address bar.
I grabbed some random links from X and hacked around with the meta tags of privet, business, and government
links that failed
-----------------
yahoo.com
www.yahoo.comhttp://yahoo.comhttp://www.yahoo.comhttps://infowars.com/https://www.infowars.com/http://stewpeters.com/http://zeeemedia.comx.com
www.x.comhttp://x.comhttp://www.x.comLink with successful validation
+++++++++++++++++++
https://www.yahoo.comhttps://x.com/i/status/1869969518908584302https://x.comhttps://www.yahoo.comhttps://okdhslive.org/Default.aspx Is the problem with Lazarus, the Brave browser, or me?
Is there any other web type component that might work better just for testing?