cjclayton
asked on
How to view title,desc,keywords from a website url passed via content field in CGI app
How do I extract/view the title, description, keywords from a website url passed via content field in CGI app.
Please alter the following code to work:
Var
sl : TStringList;
begin
sl := TStringList.Create;
try
// Look up website URL past from content field.
// Use: Request.ContentFields.Valu es['WEBSIT E_URL']
// Display website URL
sl.Add(Format('Website: %s<br><br>',[Request.Conte ntFields.V alues['WEB SITE_URL'] ]));
// Extract website header title.
sl.Add(Format('title: %s<br><br>',['????']));
// Extract website header description
sl.Add(Format('description : %s<br><br>',['????']));
// Extract website header keywords.
sl.Add(Format('keywords: %s<br><br>',['????']));
// Past back output.
Response.Content := sl.Text;
finally
sl.Free;
end;
end;
Thankss
cjclayton
Please alter the following code to work:
Var
sl : TStringList;
begin
sl := TStringList.Create;
try
// Look up website URL past from content field.
// Use: Request.ContentFields.Valu
// Display website URL
sl.Add(Format('Website: %s<br><br>',[Request.Conte
// Extract website header title.
sl.Add(Format('title: %s<br><br>',['????']));
// Extract website header description
sl.Add(Format('description
// Extract website header keywords.
sl.Add(Format('keywords: %s<br><br>',['????']));
// Past back output.
Response.Content := sl.Text;
finally
sl.Free;
end;
end;
Thankss
cjclayton
You will have to "download" the URL's HTML into your app using something like
httpget or Indy's idHTTP and then parse the tags, <title> and <meta>.
httpget or Indy's idHTTP and then parse the tags, <title> and <meta>.
ASKER
EddieShipman you are on the right track. Do you have any code samples of this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm only using Delphi 5. How do I get mshtml2_tlb imported working. Where do I download it from and how do I install it?
From the main menu select Project->Import Type Library.
When the dialog comes up go down in the list until you find
"Microsoft HTML Object Library", then click Install and install
it into whatever package you want.
When the dialog comes up go down in the list until you find
"Microsoft HTML Object Library", then click Install and install
it into whatever package you want.
I see your code,but no <title></title> found.
???????
what you want?