OembedAdapterYoutube
extends OembedAdapter
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- beforeScrape() : mixed
- Triggered before the scraper scrapes any contents.
- fixOembedUrl() : mixed
- Fix the http url in https site
- getDuration() : mixed
- Convert video duration from ISO 8601 format to seconds.
- getOembed() : mixed
- Handler our own way of extracting oembed data
- getOembedData() : mixed
- Retrieves the oembed data of a page
- getOembedUrl() : mixed
- Determines if the current link supports oembed tags
- getOpengraphData() : mixed
- Generates the opengraph data given the link to the video
- getThumbnail() : mixed
- Get video thumbnails
- getVideoId() : mixed
- Normalize the youTube video id
- isHandler() : mixed
- Determines if the adapter is currently the handler for the given url
- isValid() : mixed
- Tests to see if the url is a valid url for this adapter
- scrape() : mixed
- Override the parent's behavior as we do not want to scrape video pages as the ip could be banned
- setContents() : mixed
- Allows caller to set the contents in the adapter
- setParser() : mixed
- Allows caller to set the parser in the adapter
- simulateOembedData() : mixed
- Simulate oembed data
- isLiveUrl() : mixed
- Determines if the current url is a live youtube feed
- isWordpress() : mixed
- Determines if the target site is a wordpress site
Properties
$contents
public
mixed
$contents
= ''
$oembed
public
mixed
$oembed
= \false
$parser
public
mixed
$parser
= \null
$url
public
mixed
$url
= \null
Methods
__construct()
public
__construct(mixed $url) : mixed
Parameters
- $url : mixed
beforeScrape()
Triggered before the scraper scrapes any contents.
public
beforeScrape() : mixed
Tags
fixOembedUrl()
Fix the http url in https site
public
fixOembedUrl(mixed $oembed) : mixed
Parameters
- $oembed : mixed
Tags
getDuration()
Convert video duration from ISO 8601 format to seconds.
public
getDuration() : mixed
Tags
getOembed()
Handler our own way of extracting oembed data
public
getOembed() : mixed
Tags
getOembedData()
Retrieves the oembed data of a page
public
getOembedData() : mixed
Tags
getOembedUrl()
Determines if the current link supports oembed tags
public
getOembedUrl() : mixed
Tags
getOpengraphData()
Generates the opengraph data given the link to the video
public
getOpengraphData(mixed $contents) : mixed
Parameters
- $contents : mixed
Tags
getThumbnail()
Get video thumbnails
public
getThumbnail() : mixed
Tags
getVideoId()
Normalize the youTube video id
public
getVideoId() : mixed
Tags
isHandler()
Determines if the adapter is currently the handler for the given url
public
isHandler(mixed $url) : mixed
Parameters
- $url : mixed
Tags
isValid()
Tests to see if the url is a valid url for this adapter
public
isValid(mixed $url) : mixed
Parameters
- $url : mixed
Tags
scrape()
Override the parent's behavior as we do not want to scrape video pages as the ip could be banned
public
scrape() : mixed
Tags
setContents()
Allows caller to set the contents in the adapter
public
setContents(mixed $contents) : mixed
Parameters
- $contents : mixed
Tags
setParser()
Allows caller to set the parser in the adapter
public
setParser(mixed $parser) : mixed
Parameters
- $parser : mixed
Tags
simulateOembedData()
Simulate oembed data
public
simulateOembedData(mixed $data) : mixed
Parameters
- $data : mixed
Tags
isLiveUrl()
Determines if the current url is a live youtube feed
private
isLiveUrl() : mixed
Tags
isWordpress()
Determines if the target site is a wordpress site
private
isWordpress(mixed $url) : mixed
Parameters
- $url : mixed