Yahoo! HD Trailers Page Format Change

It looks like Yahoo! HD Trailers Page had a slight format change and therefore broke my parser. However, the parser has now been fixed. If you see anything weird, please notify us.

I’ve also made another fix where sometimes multiple Yahoo! trailers would point to the same url. That was due to the caching logic we had. I’ve went ahead and fixed the logic and now urls should always be up-to-date.

I also wrote an array recursive comparison function. There’s probably a bunch in the wild, but I couldn’t find one on php.net:

/// <summary>
/// Does a recursive array comparison
/// </summary>
/// <param name=”array1″>1st array</param>
/// <param name=”array2″>2nd array</param>
/// <returns>if the 2 arrays match</returns>
function array_equals_recursive( $array1, $array2 )
{
    if( count( array_diff_assoc( $array1, $array2 )) != 0 ||
        count( array_diff_assoc( $array2, $array1 ) ) != 0 )
    {
        return false;
    }
   
    foreach( array_keys( $array1 ) as $key )
    {
        if( is_array( $array1[ $key ] ) ||
            is_array( $array2[ $key ] ) )
        {
            if( !is_array( $array1[ $key ] ) ||
                !is_array( $array2[ $key ] ) ||
                !array_equals_recursive(
                    $array1[ $key ],
                    $array2[ $key ] ) )
            {
                return false;
            }
        }
    }
   
    return true;
}

6 thoughts on “Yahoo! HD Trailers Page Format Change

Leave a Reply