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

Class: Services_oEmbed

Source Location: /Services_oEmbed-0.2.1/Services/oEmbed.php

Class Overview


Base class for consuming oEmbed objects


Author(s):

Version:

  • Release: @version@

Copyright:

  • 2008 Digg.com, Inc.

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 87]
Base class for consuming oEmbed objects

  1.  <?php
  2.  
  3.  require_once 'Services/oEmbed.php';
  4.  
  5.  // The URL that we'd like to find out more information about.
  6.  $url 'http://flickr.com/photos/joestump/2848795611/';
  7.  
  8.  // The oEmbed API URI. Not all providers support discovery yet so we're
  9.  // explicitly providing one here. If one is not provided Services_oEmbed
  10.  // attempts to discover it. If none is found an exception is thrown.
  11.  $oEmbed = new Services_oEmbed($urlarray(
  12.      Services_oEmbed::OPTION_API => 'http://www.flickr.com/services/oembed/'
  13.  ));
  14.  $object $oEmbed->getObject();
  15.  
  16.  // All of the objects have somewhat sane __toString() methods that allow
  17.  // you to output them directly.
  18.  echo (string)$object;
  19.  
  20.  ?>



[ Top ]


Class Variables

$options = array(
        self::OPTION_TIMEOUT    => 3,
        self::OPTION_API        => null,
        self::OPTION_USER_AGENT => 'Services_oEmbed @package-version@'
    )

[line 126]

Options for oEmbed requests
  • Var: The options for making requests
  • Access: protected

Type:   array


[ Top ]

$url =  null

[line 137]

URL of object to get embed information for
  • Var: Net_URL2 instance of URL of object
  • Access: protected

Type:   object


[ Top ]



Method Detail

discover   [line 300]

string discover( string $url)

Discover an oEmbed API

Parameters:

string   $url   —  The URL to attempt to discover oEmbed for

[ Top ]

getObject   [line 231]

object The getObject( [array $params = array()])

Get the oEmbed response

Parameters:

array   $params   —  Optional parameters for

[ Top ]

__construct (Constructor)   [line 149]

void __construct( string $url, [array $options = array()])

Constructor

Parameters:

string   $url   —  The URL to fetch an oEmbed for
array   $options   —  A list of options for the oEmbed lookup

[ Top ]

setOption   [line 180]

void setOption( mixed $option, mixed $value)

Set an option for the oEmbed request

Parameters:

mixed   $option   —  The option name
mixed   $value   —  The option value

[ Top ]

_set_oembed_api   [line 209]

string _set_oembed_api( string $value)

Set the API option

Parameters:

string   $value   —  The API's URI

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:01:21 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.