ACCEPTED EVENTS

count

Instructs the component to count tags or attributes on the given page (referenced by a URI) or direct HTML code given as a scalarref. Takes a hashref as an argument, the possible keys/value of that hashref are as follows:

event

{ event => 'results_event', }

Mandatory. Specifies the name of the event to emit when results are ready. See OUTPUT section for more information.

where

{ where => 'http://zoffix.com/', }
{ where => \ $html_code, }

Mandatory. Takes either a string that must be a URI to the page with HTML code or a scalarref that references actual HTML code. This code will be used for counting.

what

{ what => [ qw/div span a/ ], }
{ what => 'div', }

Mandatory. Takes either an arrayref or a scalar. Specifying a scalar is the same as specifying an arrayref with just that scalar in it. The what argument specifies the names of HTML tags or attributes that you want to count.

tag.

{ type => 'tag', }
{ type => 'attr', }

Optional. Takes two valid strings: tag or attr. Specifies what you wish to count: tags or attributes. Defaults to:tag

The event handler set up to handle the event which you've specified in the event argument to count() method/event will receive input in the $_[ARG0] in a form of a hashref. The possible keys/value of that hashref are as follows:

what, type and where

The what, type and where keys will contain whatever you passed to the count() event/method as their values. If you didn't specify the type argument, its value in the response will be its default value.

user defined

{ '_blah' => 'foos' }

Any arguments beginning with _ (underscore) passed into the count() event/method will be present intact in the result.