construct_info_retrieval_error( $request, $response );
} else {
$json = json_decode( $response['body'] );
if ( empty( $json->query->results ) ) {
$result = new WP_Error( 'yahooscreen_invalid_url', sprintf( __( 'Error retrieving video information for http:%1$s. Check to be sure this is a valid Yahoo Screen URL.', 'video-thumbnails' ), $url ) );
} else {
$result = $json->query->results->meta->content;
$result_array = explode( 'http://', $result );
if ( count( $result_array ) > 1 ) {
$result = 'http://' . $result_array[count( $result_array )-1];
}
}
}
return $result;
}
// Test cases
public static function get_test_cases() {
return array(
array(
'markup' => '',
'expected' => 'http://media.zenfs.com/en-US/video/video.abcnewsplus.com/7c70071008e3711818517f19b6ad9629',
'expected_hash' => '22c2b172b297cf09511d832ddab7b9f5',
'name' => __( 'iFrame Embed', 'video-thumbnails' )
),
);
}
}
?>