ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
yandex_xml_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| set ($FieldName, $FieldValue)
| get_position ($Domain, $Query, $Region=0)
| get_position_and_url ($Domain, $Query, $Region=0)
| get_url ($Domain, $Query, $Region=0)

## Data Fields
| $Security = false
| $Key = ''
| $User = '/'

## Detailed Description

Class provides Yandex.XML API.

Author
  Dodonov A.A.

Definition at line 26 of file yandex_xml.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 54 of file yandex_xml.php.

{
try
{
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Member Function Documentation

get_position | ( |  | $Domain,
|  |  | $Query,
|  |  | $Region = `0`
| ) |  |

Function returns site position.

Parameters

  $Domain | - Site.
  $Query | - Query.
  $Region | - Region.

Returns
  Position.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 272 of file yandex_xml.php.

{
try
{
$Domain = str_ireplace( 'http://' , '' , $Domain );
$Domain = rtrim( $Domain , '/\\' );
$Response = $this->search_query( $Query , $Region );
$Response = $this->parse_response( $Response );
$Counter = 1;
foreach( $Response as $Item )
{
if( strtolower( $Item->domain ) == strtolower( $Domain ) )
{
return( $Counter );
}
$Counter++;
}
return( false );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_position_and_url | ( |  | $Domain,
|  |  | $Query,
|  |  | $Region = `0`
| ) |  |

Function returns site position.

Parameters

  $Domain | - Site.
  $Query | - Query.
  $Region | - Region.

Returns
  array( $Position , $URL ).

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 331 of file yandex_xml.php.

{
try
{
$Domain = str_ireplace( 'http://' , '' , $Domain );
$Domain = rtrim( $Domain , '/\\' );
$Response = $this->search_query( $Query , $Region );
$Response = $this->parse_response( $Response );
if( empty( $Response ) )
{
return( array( false , false ) );
}
$Counter = 1;
foreach( $Response as $Item )
{
if( strtolower( $Item->domain ) == strtolower( $Domain ) )
{
return( array( $Counter , "$Item->url" ) );
}
$Counter++;
}
return( array( $Counter < count( $Response ) ? $Counter : 0 , 'undefined' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_url | ( |  | $Domain,
|  |  | $Query,
|  |  | $Region = `0`
| ) |  |

Function returns site position.

Parameters

  $Domain | - Site.
  $Query | - Query.
  $Region | - Region.

Returns
  Position.

Exceptions

  Exception | - An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 393 of file yandex_xml.php.

{
try
{
$Domain = str_ireplace( 'http://' , '' , $Domain );
$Domain = rtrim( $Domain , '/\\' );
$Response = $this->search_query( "$Query site:$Domain" , $Region );
$Response = $this->parse_response( $Response );
foreach( $Response as $Item )
{
if( strtolower( $Item->domain ) == strtolower( $Domain ) )
{
return( "$Item->url" );
}
}
return( false );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

set | ( |  | $FieldName,
|  |  | $FieldValue
| ) |  |

Function sets field.

Parameters

  $FieldName | - Field name.
  $FieldValue | - Field value.

Author
  Dodonov A.A.

Definition at line 108 of file yandex_xml.php.

{
$this->$FieldName = $FieldValue;
}

## Field Documentation

$Key = ''

Key.

Author
  Dodonov A.A.

Definition at line 76 of file yandex_xml.php.

$Security = false

Cached objects.

Author
  Dodonov A.A.

Definition at line 38 of file yandex_xml.php.

$User = '/'

User.

Author
  Dodonov A.A.

Definition at line 88 of file yandex_xml.php.

The documentation for this class was generated from the following file:

- packages/xml/packages/yandex_xml/yandex_xml.php