Loading ...
Sorry, an error occurred while loading the content.

extract keywords

Expand Messages
  • Adem Erisek
    Hi Everyone, I want to extract keywords from any web site. I wrote some codes bu it doesn`t work... Do you have any idea about this part ? My code:
    Message 1 of 2 , Dec 10, 2006
    • 0 Attachment
      Hi Everyone,

      I want to extract keywords from any web site. I wrote some codes bu it doesn`t work...

      Do you have any idea about this part ?
      My code:

      #!/usr/bin/perl
      use strict;
      use warnings;
      #use CGI qw/:standard/;
      use LWP::Simple;
      url="http://www.yahoo.com";

      my $content=get $url1;

      my @row=split(/</, $content);
      my $keywords;
      foreach(@row)
      {
      if(/meta name=\"keywords\"/){
      $keywords = $_;

      $keywords=~s/meta name=\"keywords\" content= (.*?)\/>/$1,$2,$3;
      #meta name=\"keywords\" content=(.+){3}\/>; ([^,]+), ([^,]+) \/>/$1,$2,$3/;
      print $keywords;
      }
      }














      ---------------------------------
      Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers.

      [Non-text portions of this message have been removed]
    • Hans Witschi
      Keywords? What exactly are you looking for? ... [Non-text portions of this message have been removed]
      Message 2 of 2 , Dec 10, 2006
      • 0 Attachment
        Keywords? What exactly are you looking for?




        On 12/10/06, Adem Erisek <ademerisek@...> wrote:
        >
        > Hi Everyone,
        >
        > I want to extract keywords from any web site. I wrote some codes bu it
        > doesn`t work...
        >
        > Do you have any idea about this part ?
        > My code:
        >
        > #!/usr/bin/perl
        > use strict;
        > use warnings;
        > #use CGI qw/:standard/;
        > use LWP::Simple;
        > url="http://www.yahoo.com";
        >
        > my $content=get $url1;
        >
        > my @row=split(/</, $content);
        > my $keywords;
        > foreach(@row)
        > {
        > if(/meta name=\"keywords\"/){
        > $keywords = $_;
        >
        > $keywords=~s/meta name=\"keywords\" content= (.*?)\/>/$1,$2,$3;
        > #meta name=\"keywords\" content=(.+){3}\/>; ([^,]+), ([^,]+)
        > \/>/$1,$2,$3/;
        > print $keywords;
        > }
        > }
        >
        > ---------------------------------
        > Need a quick answer? Get one in minutes from people who know. Ask your
        > question on Yahoo! Answers.
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.