Professional Documents
Culture Documents
import
import
import
import
import
import
import
java.applet.Applet;
java.awt.Frame;
java.awt.List;
java.awt.*;
java.net.*;
java.util.*;
java.awt.event.*;
java.io.*;
//------------------------------------------------------------------------------------------------------------------------------//
// HOW TO COMPILE THIS PROGRAM
//
// copyleft mark b springer 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,20
09 ,2010,2011
//
// copyleft deacons folly software, 21 deeacons folly road , north harwich , ma.
, 02645
//
//
Sun Sep 06 11:42:09 EDT 2009
//
// 1 GO TO http://java.sun.com
//
//
//
// 2 DOWNLOAD THE JDK IT IS FREE TOO
//
//
//
// 3 AFTER YOU INSTALL THE JDK TYPE
//
//
javac skim_mail_k.java
//
TYPE
//
java skim_mail_k
//
//
//-----------------------------------------------------------------------------------------------//
class skim_mail_k
{
//skim_mail_k skim_mail_k skim_mail_k skim_mail_k x2t skim_mail_k skim_mail_k sk
im_mail_k skim_mail_k skim_mail_k skim_mail_k
//skim_mail_k skim_mail_k skim_mail_k skim_mail_k skim_mail_k skim_mail_k skim_m
ail_k skim_mail_k skim_mail_k skim_mail_k skim_mail_k
//skim_mail_k skim_mail_k skim_mail_k xt xt xt xt xt xt xt tx
//-------------------------------------//
// start extract_equal_slash function //
// give it 1 string
//
// and the output appears in the lower //
// window
//
//-------------------------------------//
{
if ( (end_of_end+5)<= realend
{
if( (search_string.substring( end_of_end
|| (search_string.substring( end_of_end
|| (search_string.substring( end_of_end
)
{
i_End_Of_Find = end_of_end ;
int i_length_Of_Input_List = (skim_mail_k.l_Output_list).countIte
ms();
//-------------------------------//
// we must prefix the PARENT URL //
// only if a relative URL
//
//-------------------------------//
if((search_string.substring( i_Start_Of_Find , i_Start_Of_Find+4 )).compareTo("h
ttp") != 0
&& (search_string.substring( i_Start_Of_Find , i_Start_Of_Find+3 )).compareTo("w
ww" ) != 0
) full_sentence = skim_mail_k.BASE_URL + "/";
//-------------------------------//
// we must prefix the PARENT URL //
// only if a relative URL
//
//-------------------------------//
if ( (i_Start_Of_Find+4)<= realend )
{
if((search_string.substring( i_Start_Of_Find , i_Start_Of_Find+3 )).equals("www"
) )
full_sentence = "http://";
}
//-------------------------------//
// we must add the find
//
//-------------------------------//
full_sentence = full_sentence + search_string.substring( i_Start_Of_Find , i_En
d_Of_Find ) ;
//-------------------------------//
// first find is special case
//
//-------------------------------//
if ( i_length_Of_Input_List == 0)
skim_mail_k.l_Output_list.addItem (full_sentence );
//-------------------------------//
// all other cases
//
//-------------------------------//
if ( i_length_Of_Input_List > 0)
no_duplicate( full_sentence );
full_sentence = "";
continue top ;
}
}
}
}
}
}
} //
END OF =>
for (y = i_End_Of_Find ;list_pointer< realend ; y++ )
//-------------------------------------//
//end of extract_equal_slash function //
//-------------------------------------//
//-------------------------------------//
// start extract_HREF="
function //
// give it 1 string
//
// and the output appears in the lower //
// window
//
//-------------------------------------//
public static void extract_HREF( String search_string)
{
int end_of_end
= 0 ;
int start_of_end
= 0 ;
int list_pointer = 0 ;
int i_Start_Of_Find = 0 ;
int i_End_Of_Find = 0 ;
String full_sentence = "";
String search_item = "HREF=\"" ;
int item_length
= search_item.length() ;
int realend
= search_string.length() ;
//---------------------------------------//
//
end of data
//
//---------------------------------------------------------------//
//
loop is for number of characters in the item
//
//---------------------------------------------------------------//
top:
for (start_of_end= end_of_end ; start_of_end < realend ; start_of_end++ )
{
if ( ( start_of_end+item_length )<= realend ) // enough string left
to check ??
{ // if yes is it a match ??
//-------------------------------//
//
start comparison
//
//-------------------------------//
if((search_string.substring( start_of_end , start_of_end+item_length ) ).equals(
search_item ) )
{
//-------------------------------------------//
// remember where you found the start of it //
// plus the beginning HREF="
//
// WHICH WE DO NOT WANT
//
//-------------------------------------------//
i_Start_Of_Find = start_of_end+item_length ;
//-------------------------------------------//
// delete previous directory commands
//
// ie.
../
//
// WHICH WE DO NOT WANT
//
//-------------------------------------------//
while ( (search_string.substring( i_Start_Of_Find , i_Start_Of_Find+1 ) ).equal
s( "." ) )
i_Start_Of_Find++ ;
//-------------------------------------------//
// delete previous directory commands
//
// ie.
../
//
// WHICH WE DO NOT WANT
//
//-------------------------------------------//
while ( (search_string.substring( i_Start_Of_Find , i_Start_Of_Find+1 ) ).equal
s( "/" ) )
i_Start_Of_Find++ ;
//----------------------------------------------//
// start loop to look for closing delimiter //
//----------------------------------------------//
for(end_of_end=i_Start_Of_Find; end_of_end<=realend; end_of_end++)// st
art looking for the end of it
{
if ( (end_of_end+1)<= realend ) // enough string left to check ??
{
if( (search_string.substring( end_of_end , end_of_end+1 ) ).equals( "\"" )
|| (search_string.substring( end_of_end , end_of_end+1 ) ).equals( " " )
)
{
i_End_Of_Find = end_of_end ;
int i_length_Of_Input_List = (skim_mail_k.l_Output_list).countIte
ms();
//-------------------------------//
// we must prefix the PARENT URL //
// only if a relative URL
//
//-------------------------------//
if ( (i_Start_Of_Find+5)<= realend )
{
if((search_string.substring( i_Start_Of_Find , i_Start_Of_Find+4 )).compareTo("h
ttp") != 0
&& (search_string.substring( i_Start_Of_Find , i_Start_Of_Find+3 )).compareTo("w
ww" ) != 0
) full_sentence = skim_mail_k.BASE_URL + "/";
}
//-------------------------------//
// we must prefix the PARENT URL //
// only if a relative URL
//
//-------------------------------//
if ( (i_Start_Of_Find+4)<= realend )
{
if((search_string.substring( i_Start_Of_Find , i_Start_Of_Find+3 )).equals("www"
) )
full_sentence = "http://";
}
//-------------------------------//
// we must add the find
//
//-------------------------------//
full_sentence = full_sentence + search_string.substring( i_Start_Of_Find , i_En
d_Of_Find ) ;
//-------------------------------//
// first find is special case
//
//-------------------------------//
if ( i_length_Of_Input_List == 0)
skim_mail_k.l_Output_list.addItem (full_sentence );
//-------------------------------//
// all other cases
//
//-------------------------------//
if ( i_length_Of_Input_List > 0)
no_duplicate( full_sentence );
full_sentence = "";
continue top ;
}
}
}
}
}
}
} //
END OF =>
for (y = i_End_Of_Find ;list_pointer< realend ; y++ )
//-------------------------------------//
//end of
extract_HREF=" function //
//-------------------------------------//
// start extract_src="
function //
// give it 1 string
//
// and the output appears in the lower //
// window
//
//-------------------------------------//
public static void extract_src( String search_string)
{
int end_of_end
= 0 ;
int start_of_end
= 0 ;
int list_pointer = 0 ;
int i_Start_Of_Find = 0 ;
int i_End_Of_Find = 0 ;
String full_sentence = "";
String search_item = "src=\"" ;
int item_length
= search_item.length() ;
int realend
= search_string.length() ;
//---------------------------------------//
//
end of data
//
//---------------------------------------------------------------//
//
loop is for number of characters in the item
//
//---------------------------------------------------------------//
top:
for (start_of_end= end_of_end ; start_of_end < realend ; start_of_end++ )
{
if ( ( start_of_end+item_length )<= realend ) // enough string left
to check ??
{ // if yes is it a match ??
//-------------------------------//
//
start comparison
//
//-------------------------------//
if((search_string.substring( start_of_end , start_of_end+item_length ) ).equals(
search_item ) )
{
//-------------------------------------------//
// remember where you found the start of it //
// plus the beginning HREF="
//
// WHICH WE DO NOT WANT
//
//-------------------------------------------//
i_Start_Of_Find = start_of_end+item_length ;
//-------------------------------------------//
// delete previous directory commands
//
// ie.
../
//
//-------------------------------//
// first find is special case
//
//-------------------------------//
if ( i_length_Of_Input_List == 0)
skim_mail_k.l_Output_list.addItem (full_sentence );
//-------------------------------//
// all other cases
//
//-------------------------------//
if ( i_length_Of_Input_List > 0)
no_duplicate( full_sentence );
full_sentence = "";
continue top ;
}
}
}
}
}
}
} //
END OF =>
for (y = i_End_Of_Find ;list_pointer< realend ; y++ )
//-------------------------------------//
//end of
extract_src=" function //
//-------------------------------------//
//-------------------------------------//
// start extract_href
function //
// give it 1 string
//
// and the output appears in the lower //
// window
//
//-------------------------------------//
public static void extract_href( String search_string)
{
int end_of_end
= 0 ;
int start_of_end
= 0 ;
int list_pointer = 0 ;
int i_Start_Of_Find = 0 ;
int i_End_Of_Find = 0 ;
String full_sentence = "";
String search_item = "href=\"" ;
int item_length
= search_item.length() ;
int realend
= search_string.length() ;
//---------------------------------------//
//
end of data
//
//---------------------------------------------------------------//
//
loop is for number of characters in the item
//
//---------------------------------------------------------------//
top:
for (start_of_end= end_of_end ; start_of_end < realend ; start_of_end++ )
{
if ( ( start_of_end+item_length )<= realend ) // enough string left
to check ??
{ // if yes is it a match ??
//-------------------------------//
//
start comparison
//
//-------------------------------//
if((search_string.substring( start_of_end , start_of_end+item_length ) ).equals(
search_item ) )
{
//-------------------------------------------//
// remember where you found the start of it //
// plus the beginning HREF="
//
// WHICH WE DO NOT WANT
//
//-------------------------------------------//
i_Start_Of_Find = start_of_end+item_length ;
//-------------------------------------------//
// delete previous directory commands
//
// ie.
../
//
// WHICH WE DO NOT WANT
//
//-------------------------------------------//
while ( (search_string.substring( i_Start_Of_Find , i_Start_Of_Find+1 ) ).equal
s( "." ) )
i_Start_Of_Find++ ;
//-------------------------------------------//
// delete previous directory commands
//
// ie.
../
//
// WHICH WE DO NOT WANT
//
//-------------------------------------------//
while ( (search_string.substring( i_Start_Of_Find , i_Start_Of_Find+1 ) ).equal
s( "/" ) )
i_Start_Of_Find++ ;
//----------------------------------------------//
// start loop to look for closing delimiter //
//----------------------------------------------//
for(end_of_end=i_Start_Of_Find; end_of_end<=realend; end_of_end++)// st
art looking for the end of it
{
if ( (end_of_end+1)<= realend ) // enough string left to check ??
{
if( (search_string.substring( end_of_end , end_of_end+1 ) ).equals( "\"" )
|| (search_string.substring( end_of_end , end_of_end+1 ) ).equals( " " )
)
{
i_End_Of_Find = end_of_end ;
int i_length_Of_Input_List = (skim_mail_k.l_Output_list).countIte
ms();
//-------------------------------//
// we must prefix the PARENT URL //
// only if a relative URL
//
//-------------------------------//
if ( (i_Start_Of_Find+4)<= realend )
{
if((search_string.substring( i_Start_Of_Find , i_Start_Of_Find+4 )).compareTo("h
ttp") != 0
&& (search_string.substring( i_Start_Of_Find , i_Start_Of_Find+3 )).compareTo("w
ww" ) != 0
) full_sentence = skim_mail_k.BASE_URL + "/";
}
//-------------------------------//
// we must prefix the PARENT URL //
// only if a relative URL
//
//-------------------------------//
if ( (i_Start_Of_Find+4)<= realend )
{
if((search_string.substring( i_Start_Of_Find , i_Start_Of_Find+3 )).equals("www"
) )
full_sentence = "http://";
}
//-------------------------------//
// we must add the find
//
//-------------------------------//
full_sentence = full_sentence + search_string.substring( i_Start_Of_Find , i_En
d_Of_Find ) ;
//-------------------------------//
// first find is special case
//
//-------------------------------//
if ( i_length_Of_Input_List == 0)
skim_mail_k.l_Output_list.addItem (full_sentence );
//-------------------------------//
// all other cases
//
//-------------------------------//
if ( i_length_Of_Input_List > 0)
no_duplicate( full_sentence );
full_sentence = "";
continue top ;
}
}
}
}
}
}
} //
END OF =>
for (y = i_End_Of_Find ;list_pointer< realend ; y++ )
//-------------------------------------//
//end of
extract_HREF=" function //
//-------------------------------------//
//--------------------------------------------//
// start extract_equal_quote_slash function //
// give it 1 string
//
// and the output appears in the lower
//
// window
//
//--------------------------------------------//
public static void extract_equal_quote_slash( String search_string)
{
int end_of_end
= 0 ;
int start_of_end
= 0 ;
int list_pointer = 0 ;
int i_Start_Of_Find = 0 ;
int i_End_Of_Find = 0 ;
String full_sentence = "";
String search_item = "=\"/" ;
int item_length
= search_item.length() ;
int realend
= search_string.length() ;
//---------------------------------------//
//
end of data
//
//---------------------------------------------------------------//
//
loop is for number of characters in the item
//
//---------------------------------------------------------------//
top:
for (start_of_end= end_of_end ; start_of_end < realend ; start_of_end++ )
{
if ( ( start_of_end+item_length )<= realend )
to check ??
{ // if yes is it a match ??
//-------------------------------//
//
start comparison
//
//-------------------------------//
ttp") != 0
&& (search_string.substring( i_Start_Of_Find , i_Start_Of_Find+3 )).compareTo("w
ww" ) != 0
) full_sentence = skim_mail_k.BASE_URL + "/";
}
//-------------------------------//
// we must prefix the PARENT URL //
// only if a relative URL
//
//-------------------------------//
if ( (i_Start_Of_Find+4)<= realend )
{
if((search_string.substring( i_Start_Of_Find , i_Start_Of_Find+3 )).equals("www"
) )
full_sentence = "http://";
}
//-------------------------------//
// we must add the find
//
//-------------------------------//
full_sentence = full_sentence + search_string.substring( i_Start_Of_Find
, i_End_Of_Find ) ;
//-------------------------------//
// first find is special case
//
//-------------------------------//
if ( i_length_Of_Input_List == 0)
skim_mail_k.l_Output_list.addItem (full_sentence );
//-------------------------------//
// all other cases
//
//-------------------------------//
if ( i_length_Of_Input_List > 0)
no_duplicate( full_sentence );
full_sentence = "";
continue top ;
}
}
}
}
}
}
} //
END OF =>
for (y = i_End_Of_Find ;list_pointer< realend ; y++ )
//-------------------------------------------//
//end of extract_equal_quote_slash function //
//-------------------------------------------//
//-------------------------------------//
// start extract_http function
//
//
//
// give it 1 string
//
// and the output appears in the lower //
// window
//
//-------------------------------------//
public static void extract_http( String search_string)
{
int end_of_end
= 0 ;
int list_pointer = 0 ;
int i_End_Of_Find = 0 ;
int start_of_end
= 0 ;
int i_Start_Of_Find = 0 ;
nd ) );
//skim_mail_k.l_Output_list.addItem ( search_string.substring( i_Start_Of_Find ,
i_End_Of_Find ));
//
start_of_end= end_of_end+1; // reset counters
continue top ;
}
}
}
}
}
}
} //
END OF =>
for (y = i_End_Of_Find ;list_pointer< realend ; y++ )
//-------------------------------------//
// end of extract http function
//
//-------------------------------------//
//-------------------------------------//
// start extract_www. function
//
// give it 1 string
//
// and the output appears in the lower //
// window
//
//-------------------------------------//
public static void extract_www( String search_string)
{
int end_of_end
= 0 ;
int start_of_end
= 0 ;
int list_pointer = 0 ;
int i_Start_Of_Find = 0 ;
int i_End_Of_Find = 0 ;
String full_sentence = "";
String search_item = "www." ;
int item_length
= search_item.length() ;
int realend
= search_string.length() ;
//---------------------------------------//
//
end of data
//
//---------------------------------------------------------------//
//
loop is for number of characters in the item
//
//---------------------------------------------------------------//
top:
for (start_of_end= end_of_end ; start_of_end < realend ; start_of_end++ )
{
if ( ( start_of_end+item_length )<= realend ) // enough string left
to check ??
{ // if yes is it a match ??
//-------------------------------//
//
start comparison
//
//-------------------------------//
if( (search_string.substring( start_of_end , start_of_end+item_length ) ).equ
als( search_item ) )
{
//-------------------------------------------//
// remember where you found the start of it //
// plus the beginning www.
//
// WHICH WE DO
WANT
//
//-------------------------------------------//
i_Start_Of_Find = start_of_end ;
for(end_of_end=i_Start_Of_Find; end_of_end<=realend; end_of_end++)// st
)).compareTo("h
)).compareTo("w
)).equals("www"
i_Start_Of_Find
full_sentence = "";
continue top ;
}
}
}
}
}
}
} //
END OF =>
//-------------------------------------//
// end of extract www.
function //
//-------------------------------------//
//-------------------------------------//
// start extract_mailto function //
// give it 1 string
//
// and the output appears in the lower //
// window
//
//-------------------------------------//
public static void extract_mailto( String search_string)
{
int end_of_end
= 0 ;
int list_pointer = 0 ;
int i_End_Of_Find = 0 ;
int start_of_end
= 0 ;
int i_Start_Of_Find = 0 ;
END OF =>
//-------------------------------------//
// end of extract mailto function
//
//-------------------------------------//
// start extract function
//
//
//
//-------------------------------------//
depth = 0 ;
i_length_Of_Input_List = 0;
line_pointer= 0 ;
i_length_Of_Output_List = 0 ;
line_counter = 0 ;
skim_mail_k.geturl();
t1.start();
//---------------------------------------//
// first get number of lines
//
// in the file
//
//---------------------------------------//
i_length_Of_Input_List = (skim_mail_k.l_Input_File_List).countItems();
//---------------------------------------//
// set up a loop to process each line
//
//---------------------------------------//
for (line_pointer= 0 ;line_pointer < i_length_Of_Input_List; line_pointer++ )
{
//---------------------------------------//
// start getting lines from file
//
//---------------------------------------//
String tmp = skim_mail_k.l_Input_File_List.getItem(line_pointer);
skim_mail_k.extract_www( tmp ) ;
skim_mail_k.extract_equal_slash( tmp ) ;
skim_mail_k.extract_equal_quote_slash( tmp );
skim_mail_k.extract_http( tmp );
skim_mail_k.extract_src( tmp );
skim_mail_k.extract_HREF( tmp );
skim_mail_k.extract_href( tmp );
}
//-------------------------------------//
// depth
//
//-------------------------------------//
line_counter = 0 ;
for ( depth = 0 ; depth <9 ; depth++ )
{
int new_end = (skim_mail_k.l_Output_list).countItems() ;
for ( int eachurl = line_counter ; eachurl < new_end; eachurl++)
{
//---------------------------------------//
// select item ( highlighted on screen ) //
//---------------------------------------//
skim_mail_k.l_Output_list.select( eachurl ) ;
//--------------------------------------------//
// update number of URL's beingSearched
//
//--------------------------------------------//
(skim_mail_k.counter_field).setText( "getting link " + eachurl ) ;
String address = "";
address = skim_mail_k.l_Output_list.getItem(eachurl) ;
(skim_mail_k.location_bar).setText( address ) ;
skim_mail_k.geturl();
//
t1.start();
//--------------------------------------------//
// update number of URL's beingSearched
//
//--------------------------------------------//
address = "searching link " + eachurl ;(skim_mail_k.counter_field).setText( addr
ess ) ;
//---------------------------------------//
// first get number of lines
//
// in the file
//
//---------------------------------------//
i_length_Of_Input_List = (skim_mail_k.l_Input_File_List).countItems();
//---------------------------------------//
// set up a loop to process each line
//
// in the first URL !!!!!!!!!!!!
//
//---------------------------------------//
for (line_pointer= 0 ;line_pointer < i_length_Of_Input_List; line_pointer++ )
{
//---------------------------------------//
// start getting lines from file
//
//---------------------------------------//
String tmp = skim_mail_k.l_Input_File_List.getItem(line_pointer);
//--------------------------------------------------------------//
// check for mail while we are here
//
//--------------------------------------------------------------//
skim_mail_k.extract_mailto( tmp ) ;
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_www( tmp ) ;
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_equal_slash( tmp ) ;
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_equal_quote_slash( tmp );
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_http( tmp );
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_HREF( tmp );
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_href( tmp );
}
line_counter = new_end ;
new_end = (skim_mail_k.l_Output_list).countItems() ;
//--------------------------------------------//
// update number of URL's beingSearched
//
//--------------------------------------------//
address = "searching link " + line_counter ;
(skim_mail_k.counter_field).setText( address ) ;
if ( new_end > (new Integer (skim_mail_k.link_limit.getText()) ).intValue())
new_end = (new Integer (skim_mail_k.link_limit.getText()) ).intValue() ;
}
//-------------------------------------//
} // <== end of
depth
//
//-------------------------------------//
//---------------------------------------//
//
report
//
//---------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() > (new Integer (skim_mail_k.link_l
imit.getText()) ).intValue())
(skim_mail_k.counter_field).setText( "Done getting links" ) ;
}
//-------------------------------------//
// end of extract function
//
//-------------------------------------//
//--------------------------------------------//
// start of check for duplicate function
//
//--------------------------------------------//
public static void no_duplicate( String line_To_Check )
{
int string_size = line_To_Check.length();
String[] s_Input_List ;//used as => (xray3.l_Screen_List).getItems();
s_Input_List = (skim_mail_k.l_Output_list).getItems();
int i_length_Of_Input_List = (skim_mail_k.l_Output_list).countItems();
boolean copy = false ;
boolean shrunk = false ;
//-----------------------------------------------//
//
now check
the URL aginst all
//
//
previous URL's to prevent duplication
//
//-----------------------------------------------//
//top:
for (int list_pointer=0 ; list_pointer < i_length_Of_Input_List ; list_pointer++
)
{
string_size = line_To_Check.length();
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 1)
{
if( (line_To_Check.substring((string_size-1),string_size)).equals(",") )
line_To_Check= line_To_Check.substring( 0 , (string_size-1) ) ;
string_size = line_To_Check.length();
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 1)
{
if( (line_To_Check.substring((string_size-1),string_size)).equals("'") )
line_To_Check= line_To_Check.substring( 0 , (string_size-1) ) ;
string_size = line_To_Check.length();
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 1)
{
if( (line_To_Check.substring((string_size-1),string_size)).equals("<") )
line_To_Check= line_To_Check.substring( 0 , (string_size-1) ) ;
string_size = line_To_Check.length();
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 5)
{
if( (line_To_Check.substring((string_size-5),string_size)).equals("sprev") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 4)
{
if( (line_To_Check.substring((string_size-4),string_size)).equals("prev") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 4)
{
if( (line_To_Check.substring((string_size-4),string_size)).equals("next") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 5)
{
if( (line_To_Check.substring((string_size-5),string_size)).equals("next5") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 4)
{
if( (line_To_Check.substring((string_size-4),string_size)).equals("skip") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 1)
{
if( (line_To_Check.substring((string_size-1),string_size)).equals(".") )
line_To_Check= line_To_Check.substring( 0 , (string_size-1) ) ;
string_size = line_To_Check.length();
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size < 21 ) copy = true ;
//if( string_size > 95 ) copy = true ;
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if( string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("gif") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("mid") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 1)
{
if( (line_To_Check.substring( (string_size-1),string_size)).equals("(") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("dll") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 30)
{
if((line_To_Check.substring( 0 , 30 )).equals("http://www.siliconinvestor.com")
)
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 29)
{
if((line_To_Check.substring( 0 , 29 )).equals("http://redirect.click2net.com")
)
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 34)
{
if( (line_To_Check.substring( 0 , 34 )).equals("http://search3.go2net.com/crawle
r?") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 40)
{
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("css") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 15)
{
if( (line_To_Check.substring( 0 , 15 )).equals("http://adcenter") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 14)
{
if( (line_To_Check.substring( 0 , 14 )).equals("http://clicks.") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 21)
{
if( (line_To_Check.substring( 0 , 21 )).equals("http://www.webmarket.") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 30)
{
if( (line_To_Check.substring( 0 , 30 )).equals("http://www.zone.com/asp/script")
)
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 16)
{
if( (line_To_Check.substring( 0 , 16 )).equals("http://adserver.") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 15)
{
if( (line_To_Check.substring( 0 , 15 )).equals("http://adfinity") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 18)
{
if( (line_To_Check.substring( 0 , 18 )).equals("http://www.mp3.com") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 14)
{
if( (line_To_Check.substring( 0 , 14 )).equals("http://adforce") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 30)
{
if( (line_To_Check.substring( 0 , 30 )).equals("http://leader.linkexchange.com")
)
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 25)
{
if( (line_To_Check.substring( 0 , 25 )).equals("http://ad.doubleclick.net") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 13)
{
if( (line_To_Check.substring( 0 , 13 )).equals("http://click.") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 21)
{
if( (line_To_Check.substring( 0 , 21 )).equals("http://ad.preferences") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 21)
{
if( (line_To_Check.substring( 0 , 21 )).equals("http://www.stocksite.") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 10)
{
if( (line_To_Check.substring( 0 , 10 )).equals("http://ad0") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("jpg")
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("JPG")
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("jpe")
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("wav")
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 4)
{
if( (line_To_Check.substring( (string_size-4),string_size)).equals("aiff") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("GIF") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("asp") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("exe") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("pdf") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("mov") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 2)
{
if( (line_To_Check.substring( (string_size-2),string_size)).equals("au") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 2)
{
if( (line_To_Check.substring( (string_size-2),string_size)).equals("rm") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 2)
{
if( (line_To_Check.substring( (string_size-2),string_size)).equals("ra") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("dtd") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("ent") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 4)
{
if( (line_To_Check.substring( (string_size-4),string_size)).equals("rdct") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 4)
{
if( (line_To_Check.substring( (string_size-4),string_size)).equals("icon") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 4)
{
if( (line_To_Check.substring( (string_size-4),string_size)).equals("logo") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 4)
{
if( (line_To_Check.substring( (string_size-4),string_size)).equals("jpeg") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 3)
{
if( (line_To_Check.substring( (string_size-3),string_size)).equals("dci") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
//if(string_size > 3)
//{
//if( (line_To_Check.substring( (string_size-3),string_size)).equals("cgi") == 0
)
//
copy = true ;
//}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 1)
{
if( (line_To_Check.substring( (string_size-1),string_size)).equals("=") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 1)
{
if( (line_To_Check.substring( (string_size-1),string_size)).equals(";") )
copy = true ;
}
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
if(string_size > 1)
{
if( (line_To_Check.substring((string_size-1),string_size)).equals("/") )
line_To_Check= line_To_Check.substring( 0 , (string_size-1) ) ;
}
//---------------------------------------------------//
// check for duplicate entry
//
//
//
//---------------------------------------------------//
if( (line_To_Check).equals(s_Input_List[ list_pointer ]) )
{ copy = true ; continue ; }
}
if ( copy == false )
skim_mail_k.l_Output_list.addItem ( line_To_Check ) ;
//---------------------------------------//
// update counter
//
//---------------------------------------//
String update = "" + ( i_length_Of_Input_List ) ;
skim_mail_k.links_found.setText( update );
}
//--------------------------------------------//
// END of check for duplicate function
//
//--------------------------------------------//
//---------------------------------------------//
// start of check for duplicate mail function //
//---------------------------------------------//
public static void no_duplicate_mail( String line_To_Check )
{
String[] s_Input_List ;//used as => (xray3.l_Screen_List).getItems();
s_Input_List = (skim_mail_k.l_Upper_Window).getItems();
int i_length_Of_Upper_Window = (skim_mail_k.l_Upper_Window).countItems();
boolean copy = false ;
//-----------------------------------------------//
//
now check
the URL aginst all
//
//
previous URL's to prevent duplication
//
//-----------------------------------------------//
//---------------------------------------------------//
// check for illegal ends and types
//
//
//
//---------------------------------------------------//
n";
skim_mail_k.OUTPUT_AREA.setText(skim_mail_k.OUTPUT_COPY );
//---------------------------------------//
// update counter
//
//---------------------------------------//
String update = "" + (++skim_mail_k.emails ) ;
skim_mail_k.emails_found.setText( update );
}
}
//------------------------------------------------//
// END of check for duplicate email function
//
//------------------------------------------------//
//-------------------------------------//
// start of geturlmail function
//
//-------------------------------------//
public static void geturlmail()
{
URL url;
InputStream isIn;
int iChar;
int iCount = 0;
String tmp="" ;
char c ;
//--------------------------------------------//
// load address from location bar
//
// into variable for new URL
//
//--------------------------------------------//
tmpurl = (skim_mail_k.location_bar).getText()
// File fOut;
int xx =0 ;
String tmpurl ;
try
{
url = new URL (tmpurl);
isIn = url.openStream ();
//--------------------------------------------//
// clean list of previous contents
//
//--------------------------------------------//
skim_mail_k.l_Mail_Html_List.removeAll() ;
if (
{ skim_mail_k.l_Mail_Html_List.addItem( tmp);
tmp="";
}
}
}
catch (Exception e)
{
}
}
//-------------------------------------//
// end of geturlmail function
//
//-------------------------------------//
// start of get url
function
//
//-------------------------------------//
public static void geturl()
{
URL url;
InputStream isIn;
int iChar;
int iCount = 0;
String tmp="" ;
char c ;
//--------------------------------------------//
//
//
// load address from location bar
//
// into variable for new URL
//
//--------------------------------------------//
tmpurl = (skim_mail_k.location_bar).getText()
// File fOut;
int xx =0 ;
String tmpurl ;
//--------------------------------------------//
//
//
// now determine the base url
//
//--------------------------------------------//
int url_length= tmpurl.length();
int here = 0 ;
for( int y=0 ; y <url_length ; y++)
{
}
if ( here < 8 ) skim_mail_k.BASE_URL = tmpurl;
if ( here > 8 ) skim_mail_k.BASE_URL = tmpurl.substring( 0 , here );
//--------------------------------------------//
// END OF
//
// now determine the base url
//
//--------------------------------------------//
try
{
url = new URL (tmpurl);
isIn = url.openStream ();
//--------------------------------------------//
// clean list of previous contents
//
//--------------------------------------------//
skim_mail_k.l_Input_File_List.removeAll() ;
{ skim_mail_k.l_Input_File_List.addItem( tmp);
tmp="";
}
}
}
catch (Exception e)
{
}
}
//-------------------------------------//
// end of get url function
//
//-----------------------------------------------------------//
// define GLOBALS
//
//-----------------------------------------------------------//
public static int MINIMUM_LINKS = 0 ;
public static List l_Input_File_List ;
public static List l_Upper_Window
;
public static List l_Output_list
;
public static List l_Mail_Html_List ;
public static List l_Lower_Window
;
public static TextField location_bar ;
public static TextField counter_field ;
public static String BASE_URL="" ;
public static String OUTPUT_COPY="" ;
public static TextArea OUTPUT_AREA;
//-----------------------------------------------------------//
// define GLOBAL text fields for user input and progress
//
//-----------------------------------------------------------//
public
public
public
public
static
static
static
static
TextField
TextField
TextField
TextField
link_limit
links_found
emails_found
topic
;
;
;
;
;
//-----------------------------------------------------------//
// END OF GLOBALS DEFINITION
//
//-----------------------------------------------------------//
//
//
//-----------------------------------------------------------//
// define labels for textfields under buttons
//
//-----------------------------------------------------------//
Label lab_05 = new Label("links to find " , Label.RIGHT) ;
Label lab_06 = new Label("links " , Label.RIGHT) ;
Label lab_07 = new Label("emails " , Label.RIGHT) ;
Label lab_08 = new Label("topic " , Label.RIGHT) ;
//-----------------------------------------------------------//
// define labels
//
// AND PROGRAM TITLE BAR
//
//-----------------------------------------------------------//
Label lab_01 = new Label("") ;
Label lab_02 = new Label("") ;
Label lab_03 = new Label("") ;
Label lab_04 ;//= new Label("Extractor") ;
lab_01.setBackground( Color.lightGray)
lab_02.setBackground( Color.lightGray)
lab_03.setBackground( Color.lightGray)
lab_04 = new Label(" Skim mail(k) ")
lab_04.setFont( new Font ("TimesRoman"
l_Upper_Window
l_Output_list
l_Mail_Html_List
l_Lower_Window
l_Input_File_List
=
=
=
=
=
new
new
new
new
new
List()
List()
List()
List()
List()
;
;
;
;
, Font.PLAIN , 25 ));
;
;
;
;
;
location_bar
= new TextField("http://search.go2net.com/crawler?ge
neral=java&method=2&target=®ion=0&rpp=20&timeout=5&hpe=10");
counter_field
= new TextField(" ");
emails_found
link_limit
links_found
topic
=
=
=
=
new
new
new
new
TextField("0");
TextField("99");
TextField(" ");
TextField("email");
OUTPUT_COPY
= " cut and paste.........\n\n\n" ;
OUTPUT_AREA
= new TextArea() ;
OUTPUT_AREA.setText(OUTPUT_COPY ) ;
//-----------------------------------------------------------//
//
//
//
create a new frame mf = new MyFrame ();
//
//-----------------------------------------------------------//
//-----------------------------------------------------------//
p_Split_North.add("North" ,lab_04 );
//-----------------------------------------------------------//
// add the buttons to the "center" panel of the second
//
// border layout manager which subdivides
//
//
"North" in the outermost layout manager
//
//-----------------------------------------------------------//
p_Split_North.add( "Center" ,p_Split_Top_North);
//-----------------------------------------------------------//
// add the location bar to lower split
//
//-----------------------------------------------------------//
p_Split_North.add( "South" ,location_bar);
//-----------------------------------------------------------//
// add just filled grid to north in
p_Full_Screen
//
//-----------------------------------------------------------//
p_Full_Screen.add ("North", p_Split_North);
//-----------------------------------------------------------//
// add lists to p_Split_Center
//
//-----------------------------------------------------------//
//
p_Split_Center.add( l_Upper_Window ) ;
p_Split_Center.add( OUTPUT_AREA ) ;
//-----------------------------------------------------------//
// the following line makes the URL's
invisible
//
// by inserting an unused list into the layout manager
//
//-----------------------------------------------------------//
//
p_Split_Center.add( l_Lower_Window ) ;
//-----------------------------------------------------------//
// the following line makes the URL's visible
//
// by inserting the output list into the layout manager
//
//-----------------------------------------------------------//
p_Split_Center.add( l_Output_list ) ;
//-----------------------------------------------------------------//
// add just filled p_Split_Center to north in p_Full_Screen
//
//-----------------------------------------------------------------//
p_Full_Screen.add ("Center", p_Split_Center);
//-----------------------------------------------------------//
// add labels to east , west and south in p_Full_Screen
//
//-----------------------------------------------------------//
p_Full_Screen.add ("East" , lab_01);
p_Full_Screen.add ("West" , lab_02);
p_Full_Screen.add ("South", counter_field);
//-----------------------------------------------------------//
// add just filled p_Full_Screen to mf
//
//-----------------------------------------------------------//
mf.add ( p_Full_Screen);
//-----------------------------------------------------------//
// show the frame
//
//-----------------------------------------------------------//
mf.show ();
}
}
//-----------------------------------------------------------//
// END OF MAIN
//
//-----------------------------------------------------------//
//-------------------------------------//
// start extract function
//
//
//
//-------------------------------------//
class Extraction_Thread extends Thread {
// 1. extend class java.lang.Thread and override run()
public void run() {
//public static void extract()
{
int
int
int
int
int
//
depth = 0 ;
i_length_Of_Input_List = 0;
line_pointer= 0 ;
i_length_Of_Output_List = 0 ;
line_counter = 0 ;
skim_mail_k.geturl();
t1.start();
//---------------------------------------//
// first get number of lines
//
// in the file
//
//---------------------------------------//
i_length_Of_Input_List = (skim_mail_k.l_Input_File_List).countItems();
//---------------------------------------//
// set up a loop to process each line
//
//---------------------------------------//
for (line_pointer= 0 ;line_pointer < i_length_Of_Input_List; line_pointer++ )
{
//---------------------------------------//
// start getting lines from file
//
//---------------------------------------//
String tmp = skim_mail_k.l_Input_File_List.getItem(line_pointer);
skim_mail_k.extract_www( tmp ) ;
skim_mail_k.extract_equal_slash( tmp ) ;
skim_mail_k.extract_equal_quote_slash( tmp );
skim_mail_k.extract_http( tmp );
skim_mail_k.extract_HREF( tmp );
skim_mail_k.extract_href( tmp );
}
//-------------------------------------//
// depth
//
//-------------------------------------//
line_counter = 0 ;
for ( depth = 0 ; depth <9 ; depth++ )
{
int new_end = (skim_mail_k.l_Output_list).countItems() ;
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_equal_quote_slash( tmp );
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_http( tmp );
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_HREF( tmp );
//--------------------------------------------------------------//
// check after every extraction to see if the limit is exceeded //
//--------------------------------------------------------------//
if ( (skim_mail_k.l_Output_list).countItems() <= (new Integer (skim_mail_k.link_
limit.getText()) ).intValue())
skim_mail_k.extract_href( tmp );
}
line_counter = new_end ;
new_end = (skim_mail_k.l_Output_list).countItems() ;
//---------------------------------------//
//
report
//
//---------------------------------------//
//--------------------------------------------//
// update number of URL's beingSearched
//
//--------------------------------------------//
address = "searching link " + ( depth + eachurl) ;
(skim_mail_k.counter_field).setText( address ) ;
if ( new_end > (new Integer (skim_mail_k.link_limit.getText()) ).intValue())
new_end = (new Integer (skim_mail_k.link_limit.getText()) ).intValue() ;
}
//-------------------------------------//
} // <== end of
depth
//
//-------------------------------------//
}
//
setPriority( getPriority() +1 );
}
//---------------------------------------//
} // <== end of extract function
//
//----------------------------------------//
//-----------------------------------------------------------//
// START OF CHECK BUTTONS
//
//-----------------------------------------------------------//
skim_mail_k.extract();
skim_mail_k.t1.start();
}
//-------------------------------------//
// end of check if extract URL
//
//-------------------------------------//
//-------------------------------------//
// check if extract TOPIC
//
//-------------------------------------//
if ("Extract topic".equals (obj))
{
//--------------------------------------------//
// update
//
//--------------------------------------------//
(skim_mail_k.counter_field).setText( "Start getting links" ) ;
//-------------------------------------------------//
// java does not care about the
//
// parenthesis around the global.
//
// I use them for clarity
//
// gbg = (skim_mail_k.l_Output_list).getText() ;
//-------------------------------------------------//
//
skim_mail_k.extract();
skim_mail_k.t1.start();
}
//-------------------------------------//
// end of check if extract URL
//
//-------------------------------------//
//-------------------------------------//
// start of resume
//
//-------------------------------------//
if ("resume".equals (obj))
{
}
skim_mail_k.t1.resume() ;
//-------------------------------------//
// end of resume
//
//-------------------------------------//
//-------------------------------------//
// start of pause
//
//-------------------------------------//
if ("pause".equals (obj))
{
}
skim_mail_k.t1.suspend() ;
//-------------------------------------//
// end of pause
//
//-------------------------------------//
//-------------------------------------//
// start of exit
//
//-------------------------------------//
if ("Exit".equals (obj))
{
}
System.exit( 0) ;
//-------------------------------------//
// end of exit
//
//-------------------------------------//
// check if About
//
//-------------------------------------//
if ("About".equals (obj))
{
MyFrame mf ;
mf = new MyFrame() ;
MyDialog d;
MyWindow w;
Button btnOKDialog;
Button btnOKWindow;
w = new MyWindow (mf);
w.reshape (450, 60, 300, 300);
TextArea taAbout = new TextArea("\n
Skim mail(k) \n
protoware\n\
nmark burns springer\ndeacons folly\nnorth harwich, ma. 02645\n\n mbspringer@wor
ldnet.att.net",12 , 30 , TextArea.SCROLLBARS_NONE);
taAbout.setBackground(Color.cyan);
taAbout.setFont (new Font ("Helvetica", Font.BOLD, 18));
w.add ("Center", taAbout);
btnOKWindow = new Button ("Click to close");
w.add ("South", btnOKWindow);
w.show ();
}
//-------------------------------------//
// end of About
//
//-------------------------------------//
// check if Help
//
//-------------------------------------//
if ("Help".equals (obj))
{
MyFrame mf ;
mf = new MyFrame() ;
MyDialog d;
MyWindow w;
Button btnOKDialog;
Button btnOKWindow;
w = new MyWindow (mf);
w.reshape (300, 40, 450, 500);
TextArea taHelp = new TextArea("\n
Skim mail(k) HELP updated: April
30 1999\n___________________\n\nWhat this program does\n\n Exract email addres
ses from HTML,\nit looks for a MAILTO: tag and takes the address\nwhich follows
.\n___________________\n\n\n\n COPY THE url FROM THE LOCATION BAR\nof your favor
ite browser after a search.\nfor example: with your favorite browser go\nto a se
arch site and run a search.\ntake the the URL that comes back\nand paste it into
Extractor.\n\n\n___________________\n\nThe program slows considerably as the nu
mber of\nURL's to check grows, as each URL is checked against\nthe ever growing
list to make sure that it\nhas not already been added.\n\nFIXES:---------------\n\nAPRIL 28 1999 PAUSE AND RESUME INSTALLED\nAPRIL 28 1999 HELP UPDATED\nAPRI
L 30 1999 Base URL UPDATED\nsee lines 1759<=>1776\n___________________\n\n\n\n_
__________________\n\n\n\n___________________\n\n\n\n___________________\n\n\n\n
___________________\n\n\n\n___________________\n\n\n\n___________________\n\n\n\
n___________________\n\n\n\n___________________\n\n\n\n___________________\n\n\n
\n___________________\n\n\n\n___________________\n\n\n\n___________________\n\n\
n\n___________________\n\n\n\n___________________\n\n\n\n___________________\n\n
\n\n___________________\n\n\n\n___________________\n\n\n\n___________________\n\
n\n\n___________________\n\n\n\n___________________\n\n\n\n___________________\n
\n\n\n___________________\n\n\n\n___________________\n\n\n\n___________________\
n\n\n\n___________________\n\n\n\n___________________\n\n\n\n___________________
\n\n\n\n___________________\n\n\n\n___________________\n\n\n\n__________________
_\n\n\n\n___________________\n\n\n\n___________________\n\n\n\n_________________
__\n\n\n\n___________________\n\n\n\n___________________\n\n\n\n________________
___\n\n\n\n___________________\n\n\n\n___________________\n\n\n\n_______________
____\n\n\n\n___________________\n\n\n\n___________________\n\n\n\n______________
_____\n\n\n\n___________________\n\n\n\n___________________\n\n\n\n\n\n\n\n\n\n\
n\n\n\n\n\n\n\n\nmark burns springer\ndeacons folly\nnorth harwich, ma. 02645" ,
6 , 20 , TextArea.SCROLLBARS_BOTH);
taHelp.setBackground(Color.cyan);
taHelp.setFont (new Font ("Helvetica", Font.PLAIN, 18));
w.add ("Center", taHelp);
btnOKWindow = new Button ("Click to close");
btnOKWindow.setFont (new Font ("Helvetica", Font.BOLD, 15));
w.add ("South", btnOKWindow);
w.show ();
}
//-------------------------------------//
// END OF HELP
//
//-------------------------------------//
return (true);
//-------------------------------------------------------------------//
// <======== end of public boolean action (Event evt, Object obj ) //
//-------------------------------------------------------------------//
//-------------------------------------------------------------------//
// start of
public boolean handleEvent (Event evt)
//
//-------------------------------------------------------------------//
public boolean handleEvent (Event evt)
{
//-------------------------------------//
// start of list
//
//-------------------------------------//
if (evt.id == Event.LIST_SELECT)
{
//
skim_mail_k.select_Item( evt );
}
//-------------------------------------//
// end of list
//
//-------------------------------------//
if (evt.id == Event.WINDOW_DESTROY)
{
System.exit (0);
}
return (super.handleEvent (evt));
}
}
//-------------------------------------------------------------------//
// <======== end of
public boolean handleEvent (Event evt) //
//-------------------------------------------------------------------//
//
//-------------------------------------------------------//
class MyDialog extends Dialog
{
public MyDialog (Frame fr, String s, boolean bModal)
{
super (fr, s, bModal);
}
public boolean handleEvent (Event evt)
{
Label l;
switch (evt.id)
{
case Event.WINDOW_DESTROY:
this.dispose ();
break;
case Event.ACTION_EVENT:
if ("Click to close".equals (evt.arg))
on
{
this.dispose ();
}
break;
}
return (super.handleEvent (evt));
}
}
//
//---------------------------//
class MyWindow extends Window
{
public MyWindow (Frame fr)
{
super (fr);
}
public boolean handleEvent (Event evt)
{
Label l;
switch (evt.id)
{
// Dialog's OK Butt
case Event.WINDOW_DESTROY:
this.dispose ();
break;
case Event.ACTION_EVENT:
if ("Click to close".equals (evt.arg))
on
{
this.dispose ();
}
break;
}
return (super.handleEvent (evt));
}
}
// Window's OK Butt