Link to home
Start Free TrialLog in
Avatar of cjclayton
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.Values['WEBSITE_URL']

    // Display website URL
    sl.Add(Format('Website: %s<br><br>',[Request.ContentFields.Values['WEBSITE_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
Avatar of huiyue
huiyue

I don't know how to settle your problem.
I see your code,but no <title></title> found.
???????
what you want?
Avatar of Eddie Shipman
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>.

Avatar of cjclayton

ASKER

EddieShipman you are on the right track.  Do you have any code samples of this?
ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.