METHOD AND SYSTEM FOR HANDLING OF INFORMATION IN A COMPUTER NETWORK

Abstract: A method, a software robot and a system for measuring advertising on a computer network, such as the Internet. The variety of advertisements is examined at certain addresses and advertisements are then automatically looked for and their frequency is registered. Combined with manual classification of advertisements and statistics as regards the visits and prices for advertising, it is possible to assemble current statistics about advertising, both regarding volume and exposures.

Description: METHOD AND SYSTEM FOR HANDLING OF INFORMATION IN A COMPUTER NETWORK TECHNICAL FIELD The present invention relates to a method and system for obtaining and treating information associated with resources of data in computer networks. BACKGROUND As the number of web sites on the Internet increases, advertising on web sites becomes a more and more important activity. At present there are no tools for monitoring and treating information about advertising activities on the Internet. SUMMARY OF THE INVENTION An object of the present invention is thus to tackle the problem of providing detailed, general and current information about advertising activities on, for instance, web sites. In accordance with claims 1, 8 and 9, the invention shows a method, a software robot and a system for measuring advertising on a computer network, such as the Internet. The variety of advertisements is examined at certain addresses and advertisements are then automatically looked for and their frequency is registered. Combined with manual classification of advertisements and statistics as regards the number of visitors and prices for ad- vertising , it is possible to assemble current statistics about advertising, both regarding volume and exposures. The invention comprises three parts which together gives a system its functionality. • A robot which every hour, day and night, examines a number of web sites and looks for what presumably are advertisements. All such possible advertisements are saved in a database, for example, at a service provider for later classification. The robot also registers the exposure frequency of the advertisements. « An administrative part for classifying advertisements and for completing the system with other information, primarily statistics as regards the number of visits and advertisement prices. • An online part where the users of the system may study current statistics. Briefly, the invention supplies information as to what advertisements are shown where and with what frequency. When this information is combined with statistics as regards the number of visits (the number of visits per web site) and the price per exposure, a picture is given of both advertisement exposures and investments. Robot A part of the invention is a so-called robot - a program which is run without the intervention of a user - which looks for presumed advertisements on a set of web sites. The robot starts every hour, day and night, a web-surfing session where it looks for advertisements. The robot is configurated to surf to a set of addresses and then looks for, based on a set of rules of what characterizes an advertisement, everything that can be, for instance, banner ads. This is a complex algorithm which today comprises an analysis of each web page in order to find all parts of the page which can be advertisements. Each presumed advertisement is analysed by the robot with respect to size, location and information about the link which is connected to the advertisement. All the found advertisements are given a unique identity by means of a check sum which is calculated by the program and which is stored in a database. This entails that the robot recognizes advertisements that are already known by the system. New, and thus unknown advertisements, are stored for classification. The robot may also be provided with support for cookies, that is, allowing to measure the frequency of advertisements that are shown a number of times per unique visitor. Certainly, a robot can be configured to, instead of recognizing advertising, recognize other activities on a web site, such as activities on a discussion forum, for instance, chat sites. Classification The administrators of the system can at any time see how many new advertisements the robot has found. These are then classified according to product, advertiser of product, product group, unless it turns out that what the robot has found has been something else than an advertisement. In the administrative interface the administrators can also add and remove addresses which the robot is looking at and import other information to the system. The most important information concerns visiting statistics and advertisement prices. Online Part In the online part diagrams and statistics are presented as regards the development of the advertising on the various web sites that the robot examines. Examples of statistics are what banners are the most common ones, what advertisers who spend most money and what the distribution is like between different lines of business. SHORT DESCRIPTION OF THE FIGURES Figs la-c show a database structure according to the invention. Fig. 2 shows a schematic diagram of a method according to the invention. Fig. 3 shows a class diagram according to the invention. PREFERRED EMBODIMENTS In the following embodiments of the invention will be described, the embodiments pref- erably being implemented in one or more computers which are connected to a computer network such as the Internet. General Information A web service according to the invention consists of, and depends on, a number of individual parts. The robot collects information about the advertising which is stored in the database, where it is put together, aggregated, to the form which the web service needs. The following document gives a general view of the web service. The web service itself contains a number of different parts and aspects. - Graphs and Lists These fetch data from the database according to indicated choices (numbers from AggrTraffTbl, names and the like from various other tables, such as AnnonsorTbl, UrlTbl, MarkesvaraTbl, etc.). The data is shown either in lists (tables) or graphs which are created by means of AspChart. The main part of the web service is present to handle this. - Classification The classification is used to classify newly arrived advertisements with respect to the fact that it is indeed an advertisement and, if this is the case, with respect to what trademark is advertised, as well as with respect to advertiser and advertiser of a product. Before the advertisements can be shown in graphs or lists, they have to be classified. This means that the classification has to take place regularly to make the system function properly. - Various Administration Examples of admimstration are URL Administration, URL Groups, Key words. These are essentially web interfaces of the current tables in the database (UrlTbl, UrlGruppTbl, NyckelordTbl, UserTbl, etc.). - User Handling The user must log-on in order to access most of the pages in the system. Moreover, vari- ous information about the user is stored (see UserTbl). - Text Handling for Different Languages All the texts of the web service are stored in the database (TextTbl) and are fetched dynamically owing to what language the user has chosen. This also makes it possible to change most of the texts in the system directly in the web service. - System Information A number of pages show current information from the database as regards the function of the robot and the information it fetches (TraffTbl, etc.). Technical Platform The web service is developed in ASP (Active Server Pages) for Microsoft Internet Infor- mation Server version 4.0 and Microsoft SQL Server 7.0. The robot is developed in Java, see separate document. The component AspChart from ServerObjects, Inc (http ,7/www. serverobi ects . com) is used to make the graphs. Aggregation The information shown in the system emanates from a table having aggregated informa- tion (AggrTraffTbl). The table is created from untreated data that the robot gives and tells about all the individual instances advertisements have been encountered (TraffTbl), which is put together for each week and for advertisements and web sites, and, moreover, calculations as regards prices are made in advance. As a result, graphs and other information can be calculated much faster. This is made by a couple of scripts which are run on the SQL Server each night, which then adds new data to the aggregated table (see <data- base> Data Transformation Services/Local Packages/). Installation Web Files Apart from copying all the web files to a location in the file structure according to the web server, in new installations it may be necessary to adapt strURLRoot in /lib/const.inc. This has to contain the (possible) path under the root of the site where the web service is found. For instance, if the web service is under www.effekt.net/webspend/... the value here should be "webspend/". Also note that there are a number of (originally empty) li- braries which must be created under /files/chart/ where the different graphs are stored. SQL Server Apart from creating all the database tables for the database filled with correct contents, there are a number of scripts used for aggregating which have to be put in correctly. These scripts are in the original installation of the invention located in <database>/Data Transformation Services/Local Packages/. The scripts also must be made to be run, for instance every night. There has to be a correct connection string for the database in the file /lib/db.inc. Robot As regards the installation of the robot see separate documentation. Note that banners which are saved must be available for the web service in the directory /WebBanners/. Components The component AspChart is installed according to known technique. File specification Root Directory The root directory mainly contains the usual HTML-pages for the site. Directory File Description Global.asa This file is not used by the system Index.asp Main file for the site. A frame file Kontakt.asp Page for the site (the main frame) Loggedon.asp Page for the site (the main frame) Main.asp Page for the site (the main frame) Main2.asp Page for the site (the main frame) Message.asp Page to show various messages Metod.asp Page for the site (the main frame) Topp.asp Page for the site (the upper frame) foretagen.asp Page for the site (the main frame) prenumerant.asp Page for the site (the main frame) registrerasajt.asp Page for the site, to register a site registrerasajt_skicka.asp Handles the input from registrerasajt.asp switch_language.asp Switches the language. Is linked to from the flags in Topp.asp synpunkter.asp Page for the site (the main window) Admin/ The Admin directory contains various types of administrative functions. Directory File Description Admin/ GroupEdit.asp Modify a URL group (in URLGruppTbl) GroupList.asp List URL groups (in URLGruppTbl) Groupadd.asp Add a URL group (to URLGruppTbl) KeywordAdd.asp Add a key word (to NyckelordTbl) KeywordDelete.asp Remove a key word (in NyckelordTbl) KeywordEdit. asp Modify a key word (in NyckelordTbl) KeywordList.asp List key words (in NyckelordTbl) URLDelete.asp Remove a URL/APL (in URLTbl) Urladd.asp Add a URL/APL (to URLTbl) Urledit.asp Modify a URL/APL (in URLTbl) Urllist.asp List URL/APL (in URLTbl) Usradmin.asp List users (in UserTbl) Usrchng.asp Handle modifications and additions, in Usradmin.asp and Usredit.asp Usrdel.asp Remove a user (from UserTbl) Usredit.asp Modify a user, send the form to Usrchng.asp check_annonstbl.asp Information page about the contents of An- nonsTbl check_errortbl.asp Information page about the contents of Er- rorTbl checkjrobot.asp Information page about the number of found hits per site check_traff.asp Information page about the inbound hits check_trafftbl.asp Information page about the contents of raffTbl check_trafftbl_spec.asp Information page, linked to by checkjrobot.asp text_admin.asp Administration of texts (in TextTbl) Chart/ The Chart directory contains the various graphs and lists in the system. In general, each graph uses two files, an .inc file in which the actual calculation of the graph is handled, and an .asp file where the web page and the graph are shown. Directory File Description Chart/ Chart.inc General graph handling and definitions chartAPLSelected.inc Graph, calculation chartAPLTopp.asp Top-ten sites, page chartAPLTopp.inc Top-ten sites, calculation chartAPLToppNecka.asp Top-ten sites, page, "one week free version" chartAnnonseringUtveckling. asp Banner advertising evolution, page chartAnnonseringUtveckling.inc Banner advertising evolution, calculation chartAnnonsorOmsattning.asp Top-ten advertisers, page chartAnnonsorOmsattning.inc Top-ten advertisers, calculation chartAnnonsorOmsattningNecka.inc Top-ten advertisers, page, "one week free version" chartBranschBarometern.asp Line of business barometer, page chartBranschBarometern.inc Line of business barometer, calculation chartShareBransch. asp Share of voice (per line of business), page chartShareBransch.inc Share of voice (per line of business), calculation chartShareOfVoice.asp Not used chartShareOfVoice.inc Not used chart_utils.inc Various graph utilities showAUAPL.asp Listing, page showAHAPL.inc Listing, calculation showAHAPLsite.asp Listing, page showAUAPLsite.inc Listing, calculation showAllAnnonsorOmsattning.asp Listing, page showAUAnnonsorOmsattning.inc Listing, calculation showAnnonsorAktivitet.inc Listing, calculation sho wAnnonsorB anner s . asp Listing, page showAnnonsorerAktivitet.asp Listing, page showAnnonsorerAktivitet.inc Listing, calculation showBanners.asp Listing, page showBanners.inc Listing, calculation showBannersNecka.asp Listing, page showBanners_raw.asp This page lists all advertisements, for classification sho wBranschAktivitet. asp Listing, page showBranschAktivitet.inc Listing, calculation showEnAPL.asp Listing, page showEnAPL.inc Listing, calculation showEnAnnonsorOmsattning. asp Listing, page showEnAnnonsorOmsattning.inc Listing, calculation showThisWeekAPL.inc Listing, calculation sho wannonsoraktivitet. asp Listing, page showannonsoraktivitet_raw.asp Listing, page Inc/ The Inc directory contains HTML headers and footers which handles large parts of the formatting on the various pages. Directory File Description Inc/ 2spaltbotten.inc 2spalttop.inc Charttop.inc Texttop.inc chartbotten.inc generellbotten.inc generelltop.inc textbotten.inc Klass/ The Klass directory contains files which handles the classification of banners. Directory File Description Klass/ Addgroup.asp Adds trademarks and groupings Help.htm Klass.asp Handles all the classifications Lookup. asp addgroup_action.asp Lib/ The Lib directory contains help functions of different types. Directory File Description L Liibb// A Addmmiinn..iinncc Handles the log on procedure and controls access rights (admin) Const.inc Various constants, etc. Db.inc Data source, database functions Logon.asp Handles parts of the log on procedure L Looggoonn..iinncc Handles parts of the log on procedure Logout, asp Logs off a user Prim, inc Functions to access SessionQ information Private.inc Handles the log on procedure and controls access rights (user) Public.inc Includes files as admin and private but does not require access rights Utils.inc Includes other utility files (for historical reasons) db_user_update. asp Database functions, to store users in database forcelogon.asp Page which is used to force a log on procedure utils_language . asp Help functions to handle text languages utils_string.asp Help functions utils_time.asp Help functions utils_time_week.asp Help functions utils_wsold.asp Help functions, various not classified )atabase Specification ame: Webspend l the database there are 18 tables that contains the data for Webspend.net. Figure la-c shows the atabase structure. AggrTraffTbl ' his table contains aggregated data about found banners. The aggregated data are used when a iagram are drawed or when other statistiks are displayed in the webb-applikation. -evs Attribute Datatype Default Comment AnnonsID Int Identifier U LID Int Identifier Number Int (0) PrisMultipel Float (0.0) ExponeringsMultipel Float (0.0) DatumStampel Datetime cπnonsorTbl his table contains information about the advertiser, .evs Attribute Datatype Default Comment AnnonsorlD nvarchar (32) Identifier Namn nvarchar (510) DatumStampel Smalldateti e αmonsTbl his table contains information about found banners. .eys Attribute Datatype Default Comment AnnonsID int identity Identifier Chec Summa Int Storlek Int Hojd Int Bredd Int URL to the website where the HREF nvarchar (510) banner was found. FilTyp nvarchar (40) File extension for the banner. ArAnnons Bit Is a banner or not (Value 0 orl) Klassificerad Bit Is classified or not (Value 0 orl) MarkesvaralD nvarchar (32) DatumStampel Smalldatetime RecStatusCode nvarchar (2) KlassOrder Smalldatetime VariantText nvarchar (100) EgenURLID Int BAnnonsorlD nvarchar (32) OldCheckSumma Int BranschTbl This table contains information about the Line of business. Kevs Attribute Datatype Default Comment pk BranschID nvarchar (32) Identifier Narrm nvarchar (510) DatumStampel smalldatetime CookieTbl This table contains information for the robot to store cookies from the websites Keys Attribute Datatype Default Comment pk Cookield int identity Identifier URLID Int HREF nvarchar (1020) Cookie Text (") ErrorTbl This table are used by the robot to report errors that accurs. Keys Attribute Datatype Default Comment pk Errorld int identity Identifier URL varchar (255) DatumStampel Datetime Error varchar (500) URLID Int FormatTbl This table contains pattem/format-information to the robot and are used when the robot analyses and matches the websites. Keys Attribute Datatype Default Comment pk Formatld int identity Identifier Format varchar (255) MarkesvaraTbl This table contains all brands. The advertisments are klassified by the brands. Keys Attribute Datatype Default Comment pk MarkesvaralD nvarchar (32) Identifier Namn nvarchar (510) Brand name AnnonsorlD nvarchar (32) ProduktGruppID nvarchar (32) DatumStampel smalldatetime ϊyckelOrdTbl his table contains information for the robot. The robot uses the information to identify a ivertisment (banner). eys Attribute Datatype Default Comment NyckelOrdID int identity Identifier NyckelOrd nvarchar (200) DatumStampel smalldatetime RecStatusCode nvarchar (2) risTbl his table contains information about price and exposures for the websites. eys Attribute Datatype Default Comment URLID int FrDatum smalldatetime Bruttopris money Exponering int Number of exposures risTraffTbl tils table contains calculated price and exposure-information for each banner-hit. eys Attribute Datatype Default Comment Traffld int Identifier PrisMuItipel real ExponeringsMultipel real Calculated exposure value roduktgruppTbl His table contains information about the "product groups". sys Attribute Datatype Default Comment ProduktgruppID nvarchar (32) Identifier VarugruppID nvarchar (32) Namn nvarchar (510) DatumStampel smalldatetime extTbl lis table contains all the texts that are visible on webspend.net. Exept the admin-part where 1 the texts only are in Swedish. Every text is available, and should be stored in both Swedish id English and are identified by the Language - id. Edeting of text is done in the admin-part. eys Attribute Datatype Default Comment TextKey nvarchar (100) Identifier text (same in SW/Eng) Identifier Language: l(Sw) or 2 Language int (Eng) Text ntext The actual text raffTbl is table contains information for a banner-hit (when the robot has found a banner). jys Attribute Datatype Default Comment TraffID int identity Identifier AnnonsID int URLID int DatumStampel smalldatetime R GruppTbl is table contains information for URL groups. j ys Attribute Datatype Default Comment Id int identity Identifier Namn varchar (100) RLTbl iis table specifies and contains information about the sites that are being searched by the bot. ;ys Attribute Datatype Default Comment URLID int identity Identifier URL nvarchar (400) (") The site URL APL nvarchar (100) The site Name Bruttopris Money DatumStampel Smalldatetime RecStatusCode nvarchar (2) ('A') URLGruppID Int Maskin Int (1) Robot number serTbl iis table contains information about the user. ■ ys Attribute Datatype Default Comment UserlD int identity Identifier UserName nvarchar (100) UserDisplayName nvarchar (100) UserTrust Int Userlevel UserAccountActive Bit (1) UserAdminComment nvarchar (100) UserPassword nvarchar (100) Deleted Bit (0) Created Datetime Visits Int (0) ActiveFrom Datetime ActiveTo Datetime Email varchar (100) (") Phone varchar (100) (") Company varchar (200) (") LastVisit Datetime VarugruppTbl This table contains information about the "group of goods". Kevs Attribute Datatype Default Comment pk " VarugruppID nvarchar (32) Identifier BranschID nvarchar (32) Namn nvarchar (510) DatumStampel Smalldatetime INSTALLATION OF JAVA ROBOT 1. The robot makes use of Java 1.2.2. 2. There is a test environment located in computer WSITE JOSEF 3. In Database.java->database() it is necessary to modify the database connection so that it uses Webspend in the live environment. In the test environment, Ro- botwebsp is used. 4. The class path should be: <unit>:\jdkl .2.2\lib;d:\josrobot 5. The file Page Java contains a string which denotes the path to the banners which are to be stored. In the live environment it should be "f:\" and in the test environment it should be "d:\testbanners". 6. In Database.java->getURLAdress it is necessary to specify what machine (robot) you are running on. The robot then enters the database and retrieves which URLs it is to handle. The information about which robot is to take care of which URL is stored in the table "URLTbl" in the database. Thus, when a new robot is desired, one must recompile the source code and specify the number of the robot. During run-time there are three different compiled robots which each takes its part of the URLs. 7. In Page.java there are functions to download the pictures. 8. When you copy the database, it is necessary to transfer everything, including objects, not only the tables. There is a stored procedure in the database called "FindAndSaveAd" which is not copied if only the tables are copied. 9. In order to make the robot function, a local ODBC connection is needed to the database. In the test environment, the database Robotwebsp on WRUBIN is used and in the live environment, the database Webspend on WANAKIN is used. 10. In the URL table there are two fields which are very important for the robot, "Maskin" and "RecStatusCode". The field "Maskin" denotes which machine (robot) which will take care of the URL and "RecStatusCode" denotes if the URL is to be used or not. 11. The Java documentation is generated by writing: j avadoc -d j avadoc -private -use * .j ava 12. The UML-diagrams for the Java robot are located in a directory called UML, and the Java documentation is found in a directory called j avadoc. USE CASE VIEW (UML DIAGRAM) Figure 2 shows a use case view (UML diagram). CLASS VIEW Figure 3 shows a class view. ALL CLASSES Ad, Communication, CrcTable, Data, DataBase, Error, NewImageAd, Page, Robot, Site, URLAddress, WebSpendRobot CLASS AD javalang.Object I +-Ad Direct Known Subclasses: NewImageAd , public abstract class Ad, extends javaiang.Object Abstract class used as superclass for different kind of advertisement classes. All advertisement classes implement the methods of this class. Field Summary private int adld The id for the ad. private int crc The checksum for the ad. private java.sql.Timestamp date The date when the ad was found. private int urlld The id for the url/site where the ad was found. Constructor Summary Ad( ) Constructs a new Ad object with its value fields initialized to zero. AdQava.sql.Timestamp day, int checksum, int id, int aid) Constructs a new Ad object with its value fields initialized to the given values. Method Summary iinntt getAdldf ) Returns the value of the field adld. int getCrc( ) Returns the value of the field crc. j ava. sql . Timestamp getPatef ) Returns the value of the field date. int getUrlldf )Returns the value of the field ulrld. abstract int makeCrc( ) Calculates the checksum for this ad and returns the value. abstract boolean matchfint checksum) Indicates whether the given integer is equal to the checksum of this ad. void setAdldfint id) The field adld gets assigned the given value. void setCrcftnt c) The field crc gets assigned the given value, void setDate(iava.sql.Timestamp da) The field date gets assigned the given value, void setUrlldfint id) The field urlld gets assigned the given value. Methods inherited from class java.lang. Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail Date private java.sql.Timestamp date. The date when the ad was found. crc private int crc. The checksum for the ad. urlld private int urlld. The id for the url/site where the ad was found. adld private int adld. The id for the ad. Constructor Detail Ad public Ad(java.sql.Timestamp day, int checksum, int id, int aid) Constructs a new Ad object with its value fields initialized to the given values. Parameters: day - The date when the ad was found in the form of a java.sql.Timestamp. checksum - An integer with the ads checksum, id - An integer with the id for the url where the ad was found. aid - An integer with the id for the ad. Ad public Ad( ). Constructs a new Ad object with its value fields initialized to zero. Method Detail match public abstract boolean match(int checksum). Indicates whether the given integer is equal to the checksum of this ad. Abstract function, must be redefined by hereditied classes. Parameters: checksum - An integer with the comparable checksum. Returns: Returns true or false depending on whether the checksum matched or not. makeCrc public abstract int makeCrc( ). Calculates the checksum for this ad and returns the value. Abstract function, must be redefined by hereditied classes Returns: Returns the calculated checksum as an integer. getUrlld public int getUrlId( ). Returns the value of the field ulrld. Returns: Returns the private variable urlld as an integer. setUrlld public void setUrlId(int id). The field urlld gets assigned the given value. Parameters: id - An integer with the id. getAdld public int getAdId( ). Returns the value of the field adld. Returns: Returns the private variable adld as an integer. setAdld public void setAdId(int id). The field adld gets assigned the given value. Parameters: id - An integer with the id for the ad. getDate public java.sql.Timestamp getDate( ). Returns the value of the field date. Returns: Returns the private variable date as an util.sql.Timestamp. setDate public void setDate(java.sql.Timestamp da). The field date gets assigned the given value. Parameters: da - A java.sql.Timestamp with actual date. getCrc public int getCrc( ). Returns the value of the field crc. Returns: Returns the private variable crc as a long. setCrc public void setCrc(int c). The field crc gets assigned the given value. Parameters: c - A long with the checksum. CLASS COMMUNICATION javaiang.Object +— Communication public class Communication . extends java.lang.Object Handles socket, connection and takes care of cookies. Variables inStream and outStreani is working in TCP level. Field Summary private javaio.BufferedReader inStream inStream is a BufferedReader and contains the content from the url. private java.io.BufferedWriter outStream outStream is a BufferedWriter and contains the command to the url. private int port port has the value 80 that is HTTP's default port. private javamet.Socket socket socket contains a socket. protected int tid tid is an integer and contains the time used for trying to connect to the url. private java.net.URL url url contains a URL Constructor Summary Communication ) Empty constructor, puts stream to zero Method Summary (package private) static void ciassFinalize( ) java.lang. String connecτToSitefj ava.lang. String address, java.lang.St-ring cookie) Methods Connects to the given site. private java.lang. String receivefboolean b) Receiving page information one line at the time and returning it. private void send(j ava.lang. String com) Sending the command to the server as a string. Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail socket private java.net. Socket socket, socket contains a socket. url private java.net.URL url. url contains a URL port private int port, port has the value 80 that is HTTP's default port. inStream private javaio.BufferedReader inStream. inStream is a BufferedReader and contains the content from the url. outStream private java.io.BufferedWriter outStream. outStream is a BufferedWriter and contains the command to the url. tid protected int tid. tid is an integer and contains the time used for trying to connect to the url. Constructor Detail Communication public Communication ). Empty constructor, puts stream to zero Method Detail connectToSite public java.lang.String connectToSite(java.lang.String address, java.lang. String cookie) throws javalang.Exception. Methods Connects to the given site. Creates a new socket and an instream and an outstream. An exception is thrown if it does not succeeds in creating a socket. Request html file and sends cookie. Receive page information i a string. Variables strData contains last received row from server, strAHData contains all data received from server so far. Command contains the information the server wants. Closes the connection. Catches exceptions. Parameters: Address - that shall be connected to. Cookie - that belongs to that address. Returns: The content on the connected page including the header. Throws: java.lang.Exception - Exception in communication. URL is in the wrong format. java.lang.Exception - Exception in communication. Could not initialize Socket. java.lang.Exception - Exception in communication. Could not send.. java.lang.Exception - Exception in communication. Could not receive. java.lang.Exception - Exception in communication. Could not close. java.lang.Exception - Exception in communication. Could not write to Buf- feredWriter. java.lang.Exception - Exception in communication. Did not receive anything from URL. Send private void send(java.lang.String com), throws javadang.Exception. Sending the command to the server as a string. Parameters: the - command. Throws: javalang.Exception - Exception in communication. Could not write to Buf- fered Writer. receive private Java. lang. String receive(boolean b). throws java.lang.Exception Receiving page information one line at the time and returning it. Catches an exception. Returns: the page content as a string. Throws: java.lang.Exception - Exception in communication, timeout. java.lang.Exception - Exception in communication. Did not receive anything from URL. classFinalize static void classFinalize( ). throws java.lang.Throwable CLASS CRCTABLE java.lang.Object +-CrcTable public class CrcTable. extends javalang.Object. This class holds a table with 256 different hexadecimalnumbers in random order Field Summary (package private) long[] table The table with hexadecimalnumbers Constructor Summary CrcTableC Constructor that creates the table Method Summary long getTablefint index) Returns the hexadecimal- number at the tableindex of the given integer- value. Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail table long[ ] table. The table with hexadecimalnumbers Constructor Detail CrcTable public CrcTable( ). Constructor that creates the table Method Detail getTable public long getTable(int index). Returns the hexadecimalnumber at the tableindex of the given integervalue. Parameters: index - An integer with the index for the wanted number in the table. Returns: Returns the long number found at the actual index in the table. CLASS DATA java.lang.Object +~Data public class Data, extends Java. lang. Object. This class is used for storing shared information. All of its methods are synchronized. Field Summary private java.utilNector errorList Vector containing Errorobject which has appeared during the programexecution. private java.utilNector keyWordList Vector with Stringobjects representing keywords which identify ads. private int number Holds the numbers of contemporary running threads private java.utilNector searchFormat Vector with Stringobjects holding different kind of formats for searching linked sites. Constructor Summary Data( ). Constructs a new Data object with its value fields initialized to zero. Datafj ava.util .Vector format, java.utilNector keyWords, java.util.Vector errors, int n) Constructs a new Data object with its value fields initialized to the given values. Method Summary void decreaseΝumbe " jDeereases the private field number by one. java.utilNector gefErrorListf ^Returns the value of the field errorList. java.utilNector getKeyWordListf ) Returns the value of the field key Word- List, int getΝumberC ) Returns the value of the field number. java.utilNector getSearchFormatf Returns the value of the field searchFormat. void increaseΝumberf Increases the private field number by one. void sefErrorListfi ava.util.Nector errors) The field errorList gets assigned the given value. Void sefKey WordListfj ava.utilNector keyWords) The field keyWordList gets assigned the given value. void setΝumber(int n) The field number gets assigned the given value. void setSearchFormatCj ava.util.Vector format) The field search- Format gets assigned the given value. void storeErrors(j ava.utilNector errors) The field errorList increases with the given value. Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail searchFormat private java.util.Vector searchFormat. Vector with Stringobjects holding different kind of formats for searching linked sites. keyWordList private java.util.Vector keyWordList. Vector with Stringobjects representing keywords which identify ads. errorList private java.util.Vector errorList. Vector containing Errorobject which has appeared dur- ing the programexecution. number private kit number. Holds the numbers of contemporary running threads Constructor Detail Data public Data(java.util.Vector format, java.util.Vector keyWords, java.util.Vector errors, int n) Constructs a new Data object with its value fields initialized to the given values. Parameters: format - A Vector with all searchformats for linked pages in String objects. keyWords - A Vector with all keywords for ads in String objects. oldAds - A Vector with all old ads in ImageAd objects. newAds - A Vector with all new ads in NewImageAd objects. errors - A Vector with all the discovered errors in Error objects. cookies - A Vector with all the cookies for linked pages in UrlAddress objects, n - An integer which keeps the number of mutual running threads. Data public Data( ). Constructs a new Data object with its value fields initialized to zero. Method Detail getNumber public int getNumber( ). Returns the value of the field number. Returns: Returns the private variable number as an integer. setNumber public void setNumber(int n). The field number gets assigned the given value. Parameters: n - An integer with the number of running threads. increaseNumber public void increaseNumber( ). Increases the private field number by one. decreaseNumber public void decreaseNumber( ). Decreases the private field number by one. getSearchFormat public java.util.Vector getSearchFormat( ). Returns the value of the field searchFormat. Returns: Returns the private variable searchFormat as a Vector. setSearchFormat public void setSearchFormat(java.utilNector format). The field searchFormat gets assigned the given value. Parameters: format - A Vector with the searchformats stored in Stringobjects. getKeyWordList public java.utilNector getKeyWordList( ). Returns the value of the field keyWordList. Returns: Returns the private variable keyWordList as a Vector. setKeyWordList public void setKeyWordList(java.util.Nector keyWords). The field keyWordList gets assigned the given value. Parameters: keyWords - A Vector with keywords stored in Stringobjects. getErrorList public java.utilNector getErrorList( ). Returns the value of the field errorList. Returns: Returns the private variable errorList as a Vector. setErrorList public void setErrorList(java.utilNector errors). The field errorList gets assigned the given value. Parameters: errors - A Vector with the discovered errors stored in Errorobjects. storeErrors public void storeErrors(java.util .Vector errors). The field errorList increases with the given value. Parameters: errors - A Vector with new errors stored in Errorobjects. CLASS DATABASE java.lang.Object I +— DataBase public class DataBase, extends javadang.Object. The class DataBase is used for communication with the sqldatabase. The class handles opening and closing of the connection to the database and disposition and execution of sqlcommands. It also takes care of the re- suits from sqlcommands. Field Summary private java.sql.Connection con Is needed for the opening and closing of the connection to the database private java.sql.Driver driver Is needed for identifying all existing dif- ferent types of drivers on the computer private java.sql.ResultSet rs takes care of the result from the sqlcommand private java.sql.Statement stat Runs sqlcommands like select, insert, update. Constructor Summary DataBasef Constructs a new Database object taking no arguments. Method Summary private java.lang.String checkStrmg(iava.lang.String s) Checks if a String contains of the character ' and replaces it with ". (package private) static void classFinalizeC ) void closeConnectionf Closes a connection to the sqldatabase. void connectr ) Opens a connection to the sqldatabase. java.utilNector getCookiesfint id) java.util.Vector getKeyWordsC Executes the sqlcommand which fetches keywords from the table Νycke- lOrdTbl in the sqldatabase. java.util .Vector getTagFormatf Executes the sqlcommand which fetches searchformats from the table For- matTbl in the sqldatabase. java.utilNector getUrlAddresses(int id) Executes the sqlcommand which fetches URLID och URL from the table URLTbl in the sqldatabase. void saveCookie(java.lang.String cookie, java.lang.String address, int id, char ch) void sefErrorsfj ava.utilNector newErrors) Executes the sqlcommand which inserts the Errorobjects from the given inparameter, a vector, to the columns ErrorlD, URL, Error and DatumStampel into the table ErrorTbl in the sqldatabase. int sefΝewImageAdfΝewImageAd newAd, int run) void setUpdatedUrlAddressesCjava.utilNector ad- dressList) Executes the sqlcommand which inserts the UrlAddressobjects from the given inparameter, a vector, to the columns CookielD, URLID, HREF, Cookie in the table CookieTbl in the sqldatabase. int start( ) Sets starttime and gets an id for the robots execution, void stopfint id) Sets an stoptime for for the robots actual id. Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail con private java.sql.Connection con. Is needed for the opening and closing of the connection to the database driver private java.sql.Driver driver. Is needed for identifying all existing different types of drivers on the computer stat private java.sql.Statement stat. Runs sqlcommands like select, insert, update. rs private java.sql.ResultSet rs. takes care of the result from the sqlcommand Constructor Detail DataBase public DataBase( ). Constructs a new Database object taking no arguments. Method Detail connect public void connect( ). throws javaJang.Exception. Opens a connection to the sqlda- tabase. Loads and register a jdbc-odbc driver. Specifies the system DNS, database, user and password which will be used. getUrlAddresses public java.util.Vector getUrlAddresses(int id), throws java.lang.Exception Executes the sqlcommand which fetches URLID och URL from the table URLTbl in the sqldatabase. Loops through the result and puts the data in URLAdressobjects, stores them in a local Vector which is returned from the method. Returns: Returns a Vector with UrlAddressobjects. gefKeyWords public java.utilNector getKeyWords( ). throws java.lang.Exception. Executes the sqlcommand which fetches keywords from the table ΝyckelOrdTbl in the sqldatabase. Loops through the result and puts the data in Stringobjects, stores them in a local Vector which is returned from the method. Returns: Returns a Vector with Stringobjects. getTagFormat public java.util.Vector getTagFormat( ). throws java.lang.Exception Executes the sqlcommand which fetches searchformats from the table FormatTbl in the sqldatabase. Loops through the result and puts the data in Stringobjects, stores them in a local Vector which is returned from the method. Returns: Returns a Vector with Stringobjects. getCookies public java.util .Vector getCookies(int id), throws java.lang.Exception saveCookie public void saveCookie(java.lang.String cookie, java.lang. String address, int id, char ch) throws java.lang.Exception setΝewImageAd public int setΝewImageAd(ΝewImageAd new Ad, int run), throws java.lang.Exception setUpdatedUrlAddresses public void setUpdatedUrlAddresses(java.util.Vector addressList). throws java.lang.Exception. Executes the sqlcommand which inserts the UrlAddressobjects from the given inparameter, a vector, to the columns CookielD, URLID, HREF, Cookie in the table CookieTbl in the sqldatabase. The method checks if there are any new cookies for the visited sites in the inparameter, the Vector addressList. Calls the method getMax to receive the highest idnumber from the table CookieTbl in the sqldatabase. If the idnumber is zero it loops through the the Vector addressList and increases the id by one in every loop turn to get an unique id and inserts the data from the UrlAddressobject into the earlier mentioned columns in the database. If the idnumber is greater than zero the method loops through the Vector addressList and checks if some cookies already exists and only needs to be updated. If they exist the cookiecolumn in the database is updated and the UrlAddressobject is removed from the vector addressList. If there are any objects left after this the data from the UrlAddressobject are inserted along with an unique idnumber into the database. Because empty Strings can not be inserted into the database, all the Strings are checked first. During this method the autocommitfunction is disabled and commit is only made when all the sqlcommands has succeded, in the end of the method the autocommitfunction is enabled again. Parameters: addressList - A Vector with UrlAddressobjects. setErrors public void setErrors(java.utilNector newErrors) throws Java. lang.Exception. Executes the sqlcommand which inserts the Errorobjects from the given inparameter, a vector, to the columns ErrorlD, URL, Error and DatumStampel into the table ErrorTbl in the sqldatabase. The method checks if there are any new errors in the inparameter, the Vector newErrors. Calls the method getMax to receive the highest idnumber from the table ErrorTbl in the sqldatabase. Loops through the the Vector newErrors and increases the id by one in every loop turn to get an unique id and inserts the data from the Errorobject into the earlier mentioned columns in the database. Because empty Strings can not be inserted into the database, all the Strings are checked first. During this method the autocommitfunction is disabled and commit is only made when all the sqlcommands has succeded, in the end of the method the autocommitfunction is enabled again. Parameters: newErrors - A Vector with Errorobjects. start public int start( ). throws java.lang.Exception. Sets starttime and gets an id for the robots execution. Returns: Returns an int whith the id. stop public void stop(int id), throws javalang.Exception. Sets an stoptime for for the robots actual id. Parameters: id - An integer with the robots runid. closeConnection public void closeConnection( ). throws java.lang.Exception. Closes a connection to the sqldatabase. checkString private java.lang.String checkString(java.lang.String s). throws java.lang.Exception. Checks if a String contains of the character ' and replaces it with ". Parameters: s - A String. Returns: A String. classFinalize static void classFinalize( ). throws java.lang.Throwable CLASS ERROR java.lang.Object +~Error public class Error, extends java.lang.Object. This class holds errorinformation from the url/site server or a message that no ad was found. Field Summary private java.lang.String address The url where the errorCode occured. private j java.sql.Timestamp date The date for the errorCode. private int errorClass The type of errorCode. private java.lang.String errorCode The errortext/message. private int id The urlid where the errorCode occured. private int robotld At which robotbatch the error occured. Constructor Summary Errorf ) Constructs a new Error object with its value fields initialized to zero. Errorfj avaJang. String error, int i, java.lang.String addr, java.sql.Timestamp day, int type, int ri) Constructs a new Error object with its value fields initialized to the given values. Method Summary javadang. String getAddressf ) Returns the value of the field address. java.sql.Timestamp gefPatef ) Returns the value of the field date, int gefErrorClassf ) Returns the value of the field errorClass. java.lang.String getErrorCode( ) Returns the value of the field errorCode. int getldf ) Returns the value of the field id. int getRobotldf ) Returns the value of the field ro- botld. void setAddress(java.lang. String add) The field address gets assigned the given value, void setDatefjava.sql.Timestamp d) The field date gets assigned the given value. void setErrorClassCint type) The field errorClass gets assigned the given value, void setErrorCode(iava.lang.String error) The field errorCode gets assigned the given value, void setldfint i) The field id gets assigned the given value. void sefRobofldfint ri) The field robotld gets assigned the given value. Methods inherited from class j ava.lang.Obj ect clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail errorCode private java.lang.String errorCode. The errortext/message. id private int id. The urlid where the errorCode occured. address private java.lang.String address. The url where the errorCode occured. date private java.sql.Timestamp date. The date for the errorCode. errorClass private int errorClass. The type of errorCode. robotld private int robotld. At which robotbatch the error occured. Constructor Detail Error public Error(java.lang. String error, int i, javadang. String addr, java.sql.Timestamp day, int type, int ri). Constructs a new Error object with its value fields initialized to the given values. Parameters: error - A String containing the errortext/message. addr - A String with the url where the error occured. day - The date when the error was found in the form of a j ava.sql.Date. type - A number representing what kind of error it is. type - A number representing the batchid for the robot. Error public Error( ). Constructs a new Error object with its value fields initialized to zero. Method Detail getErrorCode public java.lang.String getErrorCode( ). Returns the value of the field errorCode. Returns: Returns the private variable errorCode as a String. setErrorCode public void setErrorCode(j ava.lang. String error). The field errorCode gets assigned the given value. Parameters: error - A String with the errortext/message. getld public int getld( ). Returns the value of the field id. Returns: Returns the private variable id as an integer. setld public void setld(int i). The field id gets assigned the given value. Parameters: add - An integer with the id where the error occured. getAddress public java.lang.String getAddress( ). Returns the value of the field address. Returns: Returns the private variable address as a String. setAddress public void setAddress(java.lang. String add). The field address gets assigned the given value. Parameters: add - A String with the address where the error occured. getDate public java.sql.Timestamp getDate( ). Returns the value of the field date. Returns: Returns the private variable date in the format java.sql.Date. setDate public void setDate(java.sql.Timestamp d). The field date gets assigned the given value. Parameters: d - A java.sql.Date with the actual date. getErrorClass public int getErrorClassO- Returns the value of the field errorClass. Returns: Returns the private variable errorClass as an integer. setErrorClass public void setErrorClass(int type). The field errorClass gets assigned the given value. Parameters: error - An integer with the errorclass. getRobotld public int getRobotId( ). Returns the value of the field robotld. Returns: Returns the private variable robotld as an integer. setRobotld public void setRobotId(int ri). The field robotld gets assigned the given value. Parameters: ri - An integer with the robotld. CLASS NEWIMAGEAD java.lang.Object I +-Ad +~NewImageAd public class NewImageAd. extends Ad. The NewImageAd class holds information about new ads of the type image. Field Summary private java.lang.String extension The extension for the imagefile that keeps the ad. private int height The height for the ad. private java.lang.String imageHref The address and name for the image- file that keeps the ad. private byte[] picture The bitstream for the image that keeps the ad. private int size The size, measured in bytes, for the ad. private int width The width for the ad. Fields inherited from class Ad adld. crc, date, urlld Constructor Summary NewImageAdC ) Constructs a new NewImageAd object with its value fields initialized to zero. NewImageAdfi ava. sql.Timestamp day, int checksum, int id, int aid, inthei, int wi, int si, java.lang.String im, java.lang.String ex, byte[] pic) Constructs a new NewImageAd object with its value fields initialized to the given values. Method Summary java. lang. String getExtensionf ) Returns the value of the field extension, int getHeightf ) Returns the value of the field height. javaiang.String geflmageHreff ) Returns the value of the field imageHref. byte[] getPicturef ) Returns the bitstream for the ad. int getSize( ) Returns the value of the field size. int getWidthf ) Returns the value of the field width. int makeCrc( ) Counts the checksum for this ad and returns the value. boolean matchdnt checksum) Indicates whether the given integer is equal to the checksum of this ad. void seffi> ten^on(java.lang.String ex) The field extension gets assigned the given value. void setHeightfint hei) The field height gets assigned the given value. void setlmageHreffj ava.lang. String im) The field im- ageHref gets assigned the given value. void setPicture(byte[] pic) The field picture gets assigned the given value. void setSize(int si) The field size gets assigned the given value. void sefWidth(int wi) The field width gets assigned the given value. Methods inherited from class Ad getAdld. getCrc, getDate, getUrlld, setAdld, setCrc sefDate, setUrlld Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail height private int height. The height for the ad. width private int width. The width for the ad. ize private int size. The size, measured in bytes, for the ad. imageHref private java.lang.String imageHref. The address and name for the imagefile that keeps the ad. extension private java.lang. String extension. The extension for the imagefile that keeps the ad. picture private byte[] picture. The bitstream for the image that keeps the ad. Constructor Detail NewImageAd public NewImageAd(java.sql.Timestamp day, int checksum, int id, int aid, int hei, int wi, int si, java.lang.String im, java.lang.String ex, byte[] pic). Constructs a new NewImageAd object with its value fields initialized to the given values. The superclassconstructor is called for its fields with the given values for them. Parameters: day - The date when the ad was found in the form of a java.sql.Timestamp. checksum - An integer with the ads checksum. id - An integer with the id for the url where the ad was found. aid - An integer with the id for the ad. hei - An integer with the height of the ad. wi - An integer with the width of the ad. si - An integer with the bytesize of the ad. im - A String with the address and name for the ad. ex - A String with the extension for the ad. pic - An array with bytes holding the ad's picture NewImageAd public NewImageAd( ). Constructs a new NewImageAd object with its value fields initialized to zero. The defaultconstructor for the superclass is called. Method Detail match public boolean match(int checksum). Indicates whether the given integer is equal to the checksum of this ad. Overrides: match in class Ad Parameters: checksum - An integer with the checksum. Returns: Returns true or false depending on whether the checksum matched or not. makeCrc public int makeCrc( ). Counts the checksum for this ad and returns the value. The Java class CRC32 is used for calculating the checksum. Overrides: makeCrc in class Ad Returns: Returns the calculated checksum as an integer. getHeight public int getHeight( ). Returns the value of the field height. Returns: Returns the private variable height as an integer. setHeight public void setHeight(int hei). The field height gets assigned the given value. Parameters: hei - An integer with the height for the ad. getWidth public int getWidth( ). Returns the value of the field width. Returns: Returns the private variable width as an integer. setWidth public void setWidth(int wi). The field width gets assigned the given value. Parameters: wi - An integer with the width for the ad. getSize public int getSize( ). Returns the value of the field size. Returns: Returns the private variable size as an integer. setSize public void setSize(int si). The field size gets assigned the given value. Parameters: si - An integer with the size for the ad. getlmageHref public javadang. String getImageHref( ). Returns the value of the field imageHref. Returns: Returns the private variable imageHref as a String. setlmageHref public void setImageHref(java.lang.String im). The field imageHref gets assigned the given value. Parameters: im - A String with the address and name for the ad. getExtension public javadang. String gefExtension( ). Returns the value of the field extension. Returns: Returns the private variable extension as a String. setExtension public void setExtension(j ava.lang. String ex). The field extension gets assigned the given value. Parameters: ex - A String with the extension for the ad. getPicture public byte[] getPicture( ). Returns the bitstream for the ad. Returns: Returns the private variable picture as a String. setPicture public void setPicture(byte[] pic). The field picture gets assigned the given value. Parameters: pic - A String with the bitstream for the ad. CLASS PAGE java.lang. Object I +— Page public class Page . extends java.lang.Object. Page downloads the content on the web page by using sockets and open a stream to receive the page content. Page create new Pages if there are any popups, interstitial buttons or another format that maybe could contain new page with advt. Content contains the page content i.e. everything the server sends such as header and html page Com is a communication object that can connect to a web address MyChildern contains page objects created by page and pages children Field Summary private Communication com com is a communication object . private javalang.String content content contains the page content. private java.lang.String mvAddress my Address is the pages address private java.lang.String mvCookie myCookie is the pages address private DataBase mvDataBase myDataBase is the connection to the database private int robotld robotld is the actual robots runtime id Constructor Summary Page(DataBase db, int id) Constructor Empty, initiates content to an empty string and creates a communication object, a perltool object, the address and vector Method Summary private void checkAndSavefNewImageAd nia) private java.lang.String checkBaseAddressfiavaiang.String address) private boolean checkIfAddressExists(java.utilNector foundAd- dresses, java.lang.String new Address) private java.lang.String checklfCookief ) Checks if there is a cookie and saves the result in cookie vector then returns cookie or an empty string. private boolean checklfCookieExistsCjava.utilNector cook, javaiang. String ref, javaiang. String cookie) private javaiang. String checklfErrorf ) ChecklfError examines if the string is an error message. private javaiang. String checkIflP(javaiang. String text) private javaiang. String checkΝextAddressfj avaiang. String address, java.lang.String href) (package private) static void classFinalizef ) private java.lang.String cleanStringfi avaiang.String str, char c) private javaiang. String convertToStringfi ava.util.Nector v) Convert- ToString takes in a vector and takes one element at the time and put it in a string. java.lang.String getContentf ) GetContent returns the content of content as a string javaiang.String gefMvAddressf ) getMy Address returns my Address as a string java.lang.String gefMvCookief ) getMyCookie returns myCookie as a string javaiang.String load(javaiang. String address, java.lang.String cookie) Load does connectToSite and gets the content. private void loadAdfNewImageAd newImAd) Makes a new connection to where the picture is stored. private void lookForlmageAdfint id, int numberOfTurns, java.util .Vector keywords, javaiang.String address, java.util.Vector errors, Java. util.Vector cookies, java.util.Vector foundAddresses) look- ForlmageAd searches the content of the Page for IMG tags combined with keywords and when there is a match the method creates a newl- mageAd object, puts it in a vector which is returned from the method, and calls the the method loadAd. void lookForPages(int urlid, int numberOfPages, javaiang.String address, java.util .Vector format, java.util.Vector keywords, java.uπi. Vector errors, java.util.Vector cookies, java.util. Vector foundAddresses) lookForPages searches the content of the Page for new pages and creates new Page object and tells the new Page to load it self when found. private ErrormakeError(i ava.lang.Exception e, javaiang.String ref) MakeError takes two arguments, an exception and the www-address where the exception occured. privateError makeErrorfi ava. lang. String e, javaiang.String ref) MakeError takes two arguments, a string with an errormessage and the www- address where the exception occured. void setContentfjavaiang.String c) setContent saves the string information in myContent in content, void setMvAddressfiavaiang.String a) setMy Address saves the string information in address in my Address. void sefMyCookie(j ava.lang. String a) setMyCookie saves the string information in address in my- Cookie. Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail content private java.lang.String content, content contains the page content. com private Communication com, com is a communication object . myAddress private javaiang.String myAddress. myAddress is the pages address myCookie private java.lang.String myCookie. myCookie is the pages address robotld private int robotld. robotld is the actual robots runtime id myDataBase private DataBase myDataBase. myDataBase is the connection to the database Constructor Detail Page public Page(DataBase db, int id) Constructor Empty, initiates content to an empty string and creates a communication object, a perltool object, the address and vector Method Detail getContent public javaiang.String getContent( ). GetContent returns the content of content as a string Returns: Returns the page content. setContent public void setContent(j ava.lang. String c). setContent saves the string information in my- Content in content. Parameters: c - A string with the page content. getMyAddress public javaiang.String getMyAddress( ). getMyAddress returns myAddress as a string Returns: Returns the page address. setMyAddress public void setMyAddress(javaiang. String a). setMyAddress saves the string information in address in myAddress. Parameters: c - A string with the page address. getMyCookie public java.lang.String getMyCookie( ). getMyCookie returns myCookie as a string Returns: Returns the page cookie. setMyCookie public void setMyCookie(javaiang.String a). setMyCookie saves the string information in address in myCookie. Parameters: c - A string with the page cookie. load public javaiang.String load(javaiang.String address, java.lang.String cookie) Load does connectToSite and gets the content. Load also checks if there are any error messages and if there are any cookies. If there is a 3.00 error message load will connect to that page referred in the error message. Pre condition: the address must have http://www. in front of the address. The address could be complete with page address or just to the catalog. Content will get a page content. Parameters: addr - Address contains the url address that will be examined. cookie - Cookie contains cookie, expire date. Returns: A vector with cookie and/or error messages. checklfCookie private javaiang.String checkIfCookie( ). Checks if there is a cookie and saves the result in cookie vector then returns cookie or an empty string. Returns: Vector with cookies. checklfError private javaiang.String checkIfError( ). ChecklfError examines if the string is an error message. Returns: string with the error mesage code. lookForPages public void lookForPages(int urlid, int numberOfPages, javaiang.String address, java.utilNector format, java.util .Vector keywords, java.utilNector errors, java.util.Vector cookies, Java. utilNector foundAddresses). lookForPages searches the content of the Page for new pages and creates new Page object and tells the new Page to load it self when found. Work flow 1 create a page, 2 load that page, 3 do lookforpages. When the method is ready it knows if it has any child pages. Creates more pages. Parameters: address - Address contains the page's address format - Format is a description on different html formats that can lead to another page. cookie - Cookie contains all information between cookie and expire date error - Errors contains error message code Returns: Vector with error and cookie objects. lookForlmageAd private void lookForImageAd(int id, int numberOfTurns, java.utilNector keywords, java.lang.String address, java.utilNector errors, java.util .Vector cookies, java.utilNector foundAddresses) throws javaiang.Exception. lookForlmageAd searches the content of the Page for IMG tags combined with keywords and when there is a match the method creates a newImageAd object, puts it in a vector which is returned from the method, and calls the the method loadAd. Pre conditionsioad must have been called first. Parameters: keywords - Keywords is a vector with words that often are found nearby advt. Returns: SpecialVector with all imagead objects. Throws: javaiang.Exception - Exception in lookForlmageAd. Could not load Ad. javaiang.Exception - Exception in lookForlmageAd. Could not load new Page. loadAd private void loadAd(NewImageAd newImAd). throws java.lang.Exception Makes a new connection to where the picture is stored. Parameters: href - Href contains the address that should be connected. Throws: javaiang.Exception - Exception in loadAd. Could not get image content: checkAndSave private void checkAndSave(NewImageAd nia). throws javaiang.Exception checkNextAddress private java.lang.String checkNextAddress(javaiang. String address, javaiang.String href) checkBaseAddress private java.lang.String checkBaseAddress(java.lang.String address) checklflP private javaiang.String checkIfIP(j ava.lang. String text) convertToString private javaiang.String convertToString(j ava.util .Vector v) ConvertToString takes in a vector and takes one element at the time and put it in a string. Parameters: v - A vector with elements. Returns: s A string with all vector element put in. makeError private Error makeError(javaiang.Exception e, java.lang.String ref). MakeError takes two arguments, an exception and the www-address where the exception occured. The method tests if the exception is a timeout or not and makes an error of the right kind. Parameters: e - An exception. Returns: ref A string with the url. makeError private Error makeError(javaiang.String e, javaiang.String ref). MakeError takes two arguments, a string with an errormessage and the www-address where the exception oc- cured. The method tests if the errormessage is a timeout or not and makes an error of the right kind. Parameters: e - A string with the error. Returns: ref A string with the url. checklfCookieExists private boolean checkIfCookieExists(java.utiINector cook, javaiang.String ref, javaiang.String cookie) checklfAddressExists private boolean checkIfAddressExists(java.util.Vector foundAddresses, javaiang.String new Address) cleanString private javaiang.String cleanString(javaiang. String str, char c) classFinalize static void classFinalize( ). throws javaiang.Throwable CLASS ROBOT javaiang.Object I +-Robot public class Robot, extends java.lang.Object. This class instantiates other classes in the webspendrobotpackage and then calls their methods. The Robotclass fetches all required data from the sqldatabase. It runs through all the listed sites, five at a time, and looks for ads. When all this is finished it stores all new data to the sqldatabase. Field Summary static DataBase db An instance of the DataBase class which han- dies communication with the sqldatabase. private int runld An int with the runtime id private java.util.Vector urlAddressList A vector with all the listed sites Constructor Summary Robotf ) Constructs a new Robot object with its value fields initialized to zero. Method Summary boolean checkSite(Pata data) Loops through the private variable urlAddressList, instantiates a Siteobject for each loopturn, maximum five at a time, and calls start which executes the runmethod in the Siteclass. java.utilNector getUrlAddressListf ) Returns the value of the field urlAddressList. void loadAHFromDb(Data data, javaiang.String s) Fetches data from the sqldatabase through the private DataBaseobject and puts the information in the private variable urlAddressList and in the vectors in the given Dataobjectparameter. void saveAUToPbfPata data, j avaiang. String s) Stores all new data given by the inparameters in the sqldatabase through the private PataBaseob- ject. void setUrlAddressList(java.utilNector urlList) The field urlAddressList gets assigned the given value. Methods inherited from class javaiang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail urlAddressList private java.util.Vector urlAddressList. A vector with all the listed sites runld private int runld . An int with the runtime id db public static PataBase db. An instance of the PataBase class which handles communication with the sqldatabase. Constructor Detail Robot public Robot( ). throws javaiang.Exception. Constructs a new Robot object with its value fields initialized to zero. Method Detail getUrlAddressList public java.util .Vector getUrlAddressList(). Returns the value of the field urlAddressList. Returns: Returns the private variable urlAddressList as a Vector. setUrlAddressList public void setUrlAddressList(java.util.Vector urlList). The field urlAddressList gets assigned the given value. Parameters: urlList - A vector with the addresses to the listed sites. loadAUFromDb public void loadAHFromPb(Pata data, javaiang.String s). throws javaiang.Exception Fetches data from the sqldatabase through the private DataBaseobject and puts the information in the private variable urlAddressList and in the vectors in the given Dataob- jectparameter. Parameters: data - A Dataobject, a referens with shared information. s - A String which tells if cookies should be loaded or not. Throws: java.lang.Exception - Exception in RobotioadAllFromDb. checkSite public boolean checkSite(Pata data). Loops through the private variable urlAddressList, instantiates a Siteobject for each loopturn, maximum five at a time, and calls start which executes the runmethod in the Siteclass. Parameters: data - A Pataobject, a referens with shared information. Returns: ready sets to true when ready. saveAHToDb public void saveAHToDb(Data data, javaiang.String s). throws javaiang.Exception Stores all new data given by the inparameters in the sqldatabase through the private Da- taBaseobject. Parameters: data - A Dataobject, a referens with shared information. oldlmageHits - A Vector with ImageAdobjects. s - A String which tells if cookies should be stored or not. Throws: java.lang.Exception - Exception in Robot.saveAllToDb. CLASS SITE java.lang.Object +~j avaiang.Thread +~Site All Implemented Interfaces: javaiang.Runnable , public class Site, extends j avaiang.Thread Class Site is threaded. Site creates a Pageobject and tells it to load tha page, collect the content of the page, look for new linked pages and to find all advertisment on the pages. Field Summary private Data data The data shared by all the threads, private DataBase database The connection to the database, private int robotld The id for the robots runtime. private DataBase siteDB The connection to the database, private URLAddress urlAddress The url and cookie for the site. Fields inherited from class javaiang.Thread contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccess- ControlContext, MAX JPRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, prior- ity, single_step, stillborn, stopThreadPermission, target, threadlnitNumber, threadLocals, threadQ Constructor Summary Site(Data d, URLAddress u, DataBase db, int id, DataBase db2) Constructs a new Site object with its value fields initialized to the given values. Method Summary (package private) static void classFinalizef ) private Error makeErrorfjavaiang.Exception e, javaiang.String ref, int id) MakeError takes two arguments, an exception and the www-address where the exception occured. private Error makeError iavaiang.String e. java.lang.String ref, int id) MakeError takes two arguments, a string with an errormessage and the www- address where the exception occured. void ran( ) The run method creates a thread and then a Page and tells it to run the Pageclassmethod load. Methods inherited from class javaiang.Thread activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, inter- rupt, interruptO, interrupted, isAlive, isDaemon, islnterrupted, islnterrupted, join, join, join, nextThreadNum, registerNatives, resume, resumeO, setContextClassLoader, set- Daemon, setName, setPriority, setPriorityO, sleep, sleep, start, stop, stop, stopO, suspend, suspendO, toString, yield Methods inherited from class javaiang. Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait Field Detail data private Data data. The data shared by all the threads. urlAddress private URLAddress urlAddress. The url and cookie for the site. robotld private int robotld. The id for the robots runtime. database private DataBase database. The connection to the database. siteDB private DataBase siteDB. The connection to the database. Constructor Detail Site public Site(Data d, URLAddress u, DataBase db, int id, DataBase db2). Constructs a new Site object with its value fields initialized to the given values. Parameters: d - A Dataobject with all the shared information. u - An URLAddressobject with all the information about the site. Method Detail run public void run( ). The run method creates a thread and then a Page and tells it to run the Pageclassmethod load. It checks if page contains more pages by calling the Pageclass- metho lookForPages which also looks for advertisments. All the ads is saved in the vector newImageAdList. Overrides: run in class javaiang.Thread makeError private Error makeError(javaiang.Exception e, java.lang.String ref, int id). MakeError takes two arguments, an exception and the www-address where the exception occured. The method tests if the exception is a timeout or not and makes an error of the right kind. Parameters: e - An exception. Returns: ref A string with the url. makeError private Error makeError(j ava.lang. String e, javaiang.String ref, int id) MakeError takes two arguments, a string with an errormessage and the www-address where the exception occured. The method tests if the errormessage is a timeout or not and makes an error of the right kind. Parameters: e - A string with the error. Returns: ref A string with the url. classFinalize static void classFinalize( ). throws Java. lang. Thro wable CLASS URLADDRESS java.lang.Object I +~URLAddress public class URLAddress. extends java.lang.Object. Class for storing information about the site or the cookie. Field Summary private javaiang.String address The url for the site, private java.lang.String cookie The cookie for the site. private int cookield The id for the cookie, private int urlld The id for the site. Constructor Summary URLAddressf ) Constructs a new NewImageAd object with its value fields initialized to zero. URLAddressfint id, javaiang.String add, int cold, javaiang.String co) Constructs a new UrlAddress object with its value fields initialized to the given values. Method Summary javaiang.String getAddressf ) Returns the value of the field address. javaiang.String getCookief ) Returns the value of the field cookie. int getCookieldf ) Returns the value of the field cookield. int getUrlldf ) Returns the value of the field urlld. void set Addressfi avaiang. String add) The field address gets assigned the given value, void setCookiefl avaiang. String co) The field cookie gets assigned the given value, void setCookieldfint id) The field cookield gets as- signed the given value. void sefUrlldfint id) The field urlld gets assigned the given value. Methods inherited from class javaiang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Field Detail urlld private int urlld. The id for the site. address private javaiang.String address. The url for the site. cookield private int cookield. The id for the cookie. cookie private javaiang.String cookie. The cookie for the site. Constructor Detail URLAddress public URLAddress(int id, javaiang.String add, int cold, javaiang.String co). Constructs a new UrlAddress object with its value fields initialized to the given values. Parameters: id - An integer with the id for the site. add - A String with the url for the site. cold - An integer with the id for the cookie. co - A String with the cookie for the site. URLAddress public URLAddress( ). Constructs a new NewImageAd object with its value fields ini- tialized to zero. Method Detail getUrlld public int getUrlId( ). Returns the value of the field urlld. Returns: Returns the private variable urlld as an integer. setUrlld public void setUrlId(int id). The field urlld gets assigned the given value. Parameters: id - An integer with the id for the site. getAddress public javaiang.String getAddress( ). Returns the value of the field address. Returns: Returns the private variable address as a String. setAddress public void setAddress(j avaiang. String add). The field address gets assigned the given value. Parameters: add - A String with the url for the site. getCookield public int getCookieId( ). Returns the value of the field cookield. Returns: Returns the private variable cookield as an integer. setCookield public void setCookieId(int id). The field cookield gets assigned the given value. Parameters: id - An integer with the id for the cookie. getCookie public javaiang.String getCookie( ). Returns the value of the field cookie. Returns: Returns the private variable cookie as a String. setCookie public void setCookie(javaiang.String co). The field cookie gets assigned the given value. Parameters: co - A String with the cookie for the site. CLASS WEBSPENDROBOT javaiang.Object +-WebSpendRobot public class WebSpendRobot. extends javaiang.Object Constructor Summary WebSpendRobot( ) Method Summary static void main(javaiang.String[] args) Methods inherited from class javaiang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait Constructor Detail WebSpendRobot public WebSpendRobot( ) Method Detail main public static void main(j ava.lang. String[] args)

Claims: CLAIMS 1. A method for measuring activity on web sites, comprising the steps of: - examining at least one web site with respect to the presentation of the activity, whereby the activity is identified, - storing information about the identified activities, - providing a user with the stored information. 2. A method as claimed in claim 1, wherein the activity is an advertising activity. 3. A method as claimed in claim 1, wherein the activity is activity in a discussion forum. 4. A method as claimed in claim 2, wherein the advertising activity is in the form of a banner presentation. 5. A method as claimed in claim 2 or 4, comprising the step of classifying the advertisements. 6. A method as claimed in claim 2, 4 or 5, comprising the steps of: - carrying out statistical calculations with respect to the information about the identified advertisements, - presenting statistical information at least partly obtained from the statistical calculations. 7. A method as claimed in any one of claims 1-6, wherein the examination of the web sites is carried out by a software robot which is configurated to web surf to a set of web addresses. 8. A software robot, comprising functions for examining at least one web site with respect to the presentation of activity, whereby the activity is identified and the information about the activity is provided for storage and presentation. 9. A software robot as claimed in claim 8, wherein the examination comprises web surfing to a set of web addresses. 10. A system for measuring activity on web sites, comprising: - means for examining at least one web site with respect to the presentation of the activity, whereby the activity is identified, - means for storing information about the identified activities, - means for providing a user with the stored information.

Inventors: ANDERSSON MIKAEL, ANDERSSON, MIKAEL
Applicants: AD CTRL AB, ANDERSSON MIKAEL, ANDERSSON, MIKAEL
Application year: 2000
Main classification: G06F17
IPC codes: G06Q30