Services_PageRank
[ class tree: Services_PageRank ] [ index: Services_PageRank ] [ all elements ]

Class: Services_PageRank

Source Location: /Services_PageRank-0.1.0/Services/PageRank.php

Class Overview


Services_PageRank Class


Author(s):

Version:

  • Release: 0.1.0

Copyright:

  • 2011 James Wade

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 59]
Services_PageRank Class


[ Top ]


Class Variables

$ch =

[line 77]

CheckHash generated
  • Access: protected

Type:   string


[ Top ]

$data =

[line 83]

Data fetched
  • Access: protected

Type:   string


[ Top ]

$lastEvent = array(
        'name' => 'start',
        'data' => null
    )

[line 106]

Last event in request / response handling, intended for observers

Type:   array


[ Top ]

$observers = array()

[line 100]

Observers attached to the request (instances of SplObserver)
  • Access: protected

Type:   array


[ Top ]

$pagerank =

[line 89]

PageRank parsed
  • Access: protected

Type:   string


[ Top ]

$q =

[line 71]

Query string input for the lookup URL (eg: example.com)
  • Access: protected

Type:   string


[ Top ]

$request =  null

[line 95]

A HTTP request instance
  • Access: public

Type:   HTTP_Request2


[ Top ]

$url =  'http://toolbarqueries.google.com/tbr?client=navclient-auto&ch=%s&features=Rank&q=info:%s'

[line 65]

Default PageRank Toolbar Lookup URL
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 116]

Services_PageRank __construct( [string $query = false], [HTTP_Request2 $request = null])

Constructor
  • Access: public

Parameters:

string   $query   —  Set the query string (eg: example.com)
HTTP_Request2   $request   —  Provide your HTTP request instance

[ Top ]

attach   [line 386]

void attach( SplObserver $observer)

Attaches a new observer
  • Access: public

Parameters:

SplObserver   $observer   — 

[ Top ]

detach   [line 400]

void detach( SplObserver $observer)

Detaches an existing observer
  • Access: public

Parameters:

SplObserver   $observer   — 

[ Top ]

fetch   [line 325]

string fetch( string $url)

Fetches the data
  • Return: Return data from the fetched URL
  • Throws: Services_PageRank_Exception
  • Access: protected

Parameters:

string   $url   —  A valid URL to fetch

[ Top ]

getCheckhash   [line 220]

the getCheckhash( )

Get the CheckHash
  • Return: CheckHash
  • Access: public

[ Top ]

getData   [line 280]

the getData( )

Get the Data
  • Return: Data
  • Access: public

[ Top ]

getHash   [line 233]

integer getHash( )

Generates the raw hash result for the "check hash"
  • Return: The raw hash result
  • Access: public

[ Top ]

getLastEvent   [line 448]

array getLastEvent( )

Returns the last event

Observers should use this method to access the last change in request. The following event names are possible:

  • 'setQuery' - when the query string is set (string)
  • 'setCheckhash' - when the checkhash is set (string)
  • 'setData' - when the raw data returned is set (string)
  • 'setPagerank' - when the actual pagerank is set (string)

  • Return: The array has two keys: 'name' and 'data'
  • Access: public

[ Top ]

getPagerank   [line 302]

the getPagerank( )

Get the PageRank
  • Return: PageRank
  • Access: public

[ Top ]

getQuery   [line 258]

the getQuery( )

Return the Query (eg: example.com)
  • Return: Query
  • Access: public

[ Top ]

getUrl   [line 249]

the getUrl( )

Builds the PageRank Toolbar Lookup URL with the checkhash and the query
  • Return: URL
  • Access: public

[ Top ]

hasCheckhash   [line 183]

bool hasCheckhash( )

Checks if there is a CheckHash value or not
  • Access: public

[ Top ]

lookup   [line 311]

the lookup( )

Do a PageRank lookup
  • Return: raw fetch data
  • Access: public

[ Top ]

notify   [line 412]

void notify( )

Notifies all observers
  • Access: public

[ Top ]

parse   [line 359]

string parse( )

Parses the data
  • Return: Return parsed PageRank
  • Throws: Services_PageRank_Exception
  • Access: protected

[ Top ]

query   [line 130]

string query( string $query)

Query Google for PageRank
  • Return: The parsed PageRank value
  • Access: public

Parameters:

string   $query   —  Set the query string (eg: example.com)

[ Top ]

setCheckhash   [line 196]

Services_PageRank setCheckhash( [integer $integer = ''])

Sets the CheckHash
  • Throws: Services_PageRank_Exception
  • Access: public

Parameters:

integer   $integer   —  The getHash result

[ Top ]

setData   [line 269]

Services_PageRank setData( [string $string = ''])

Sets the fetch data
  • Access: public

Parameters:

string   $string   —  The fetch data

[ Top ]

setLastEvent   [line 426]

void setLastEvent( string $name, [mixed $data = null])

Sets the last event

Set the current state of the request and notify the observers.

  • Access: public

Parameters:

string   $name   —  event name
mixed   $data   —  event data

[ Top ]

setPagerank   [line 291]

Services_PageRank setPagerank( [string $string = ''])

Sets the PageRank
  • Access: public

Parameters:

string   $string   —  The PageRank

[ Top ]

setQuery   [line 147]

Services_PageRank setQuery( string $string)

Sets the query string for the lookup (eg: example.com)
  • Throws: Services_PageRank_Exception
  • Access: public

Parameters:

string   $string   —  The query

[ Top ]

setRequest   [line 173]

Services_PageRank setRequest( [HTTP_Request2 $object = null])

Sets the request object
  • Access: public

Parameters:

HTTP_Request2   $object   —  A HTTP request instance (otherwise one will be created)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:48:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.