mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
.inc extension for PHP, Pascal, Assembly, SQL, C++, HTML and SourcePawn
This commit is contained in:
37
samples/Pascal/image_url.inc
Normal file
37
samples/Pascal/image_url.inc
Normal file
@@ -0,0 +1,37 @@
|
||||
function GetUnixMangaImageURL: Boolean;
|
||||
var
|
||||
i: Integer;
|
||||
l: TStringList;
|
||||
s: String;
|
||||
begin
|
||||
l := TStringList.Create;
|
||||
s := manager.container.PageContainerLinks[workCounter];
|
||||
Result := GetPage(TObject(l), s , manager.container.Manager.retryConnect);
|
||||
|
||||
if Self.Terminated then
|
||||
begin
|
||||
l.Free;
|
||||
parse.Free;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
parse := TStringList.Create;
|
||||
Parser := THTMLParser.Create(PChar(l.Text));
|
||||
Parser.OnFoundTag := OnTag;
|
||||
Parser.OnFoundText := OnText;
|
||||
Parser.Exec;
|
||||
Parser.Free;
|
||||
l.Free;
|
||||
if parse.Count > 0 then
|
||||
begin
|
||||
for i := 0 to parse.Count - 1 do
|
||||
begin
|
||||
if (Pos('STYLE="border', parse[i]) > 0) and (Pos('<IMG', parse[i]) > 0) then
|
||||
begin
|
||||
manager.container.PageLinks[workCounter] := Trim(GetVal(parse[i], 'SRC'));
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
parse.Free;
|
||||
end;
|
||||
Reference in New Issue
Block a user