| 1001 | | $ua->default_header( 'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5' ); |
|---|
| | 1005 | $ua->default_header( 'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,application/x-shockwave-flash,*/*;q=0.5' ); |
|---|
| 1008 | | 'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', |
|---|
| | 1012 | 'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,application/x-shockwave-flash,*/*;q=0.5', |
|---|
| 1025 | | # Extract the good word and bad word lists into arrays; |
|---|
| 1026 | | my %wordlists = ('good' => $self->{'positive_words'}, |
|---|
| 1027 | | 'bad' => $self->{'negative_words'}); |
|---|
| 1028 | | # Call the link scoring function |
|---|
| 1029 | | %scored_links = _scoreLinks($base, $content, %wordlists); |
|---|
| | 1030 | |
|---|
| | 1031 | # Check to see if the content is Flash-based. |
|---|
| | 1032 | if ($type eq "application/x-shockwave-flash") { |
|---|
| | 1033 | |
|---|
| | 1034 | # Save content to a temp file on disk. |
|---|
| | 1035 | my $tempFile = new File::Temp(SUFFIX => '.swf'); |
|---|
| | 1036 | print $tempFile $content; |
|---|
| | 1037 | $tempFile->close(); |
|---|
| | 1038 | |
|---|
| | 1039 | %scored_links = HoneyClient::Agent::Driver::ActiveContent::process( |
|---|
| | 1040 | file => $tempFile, |
|---|
| | 1041 | base_url => $base, |
|---|
| | 1042 | ); |
|---|
| | 1043 | # TODO: Check to make sure that temp files are getting deleted |
|---|
| | 1044 | # properly (when normal conditions apply). |
|---|
| | 1045 | |
|---|
| | 1046 | # Assume that all other content types are HTML-based. |
|---|
| | 1047 | } else { |
|---|
| | 1048 | |
|---|
| | 1049 | # Extract the good word and bad word lists into arrays; |
|---|
| | 1050 | my %wordlists = ('good' => $self->{'positive_words'}, |
|---|
| | 1051 | 'bad' => $self->{'negative_words'}); |
|---|
| | 1052 | # Call the link scoring function |
|---|
| | 1053 | %scored_links = _scoreLinks($base, $content, %wordlists); |
|---|
| | 1054 | } |
|---|