Exemplo n.º 1
0
 public function get_album_story_list($url = '')
 {
     if (!$url) {
         return array();
     }
     $content = http::get($url);
     $intro = http::sub_data($content, '<div id="video_word">', '</div>');
     $intro = http::remove_n(trim($intro));
     $cover = http::sub_data($content, '<div id="infoImg">', '</div>');
     $cover = http::sub_data($cover, 'src="', '"');
     preg_match_all('/<audio [\\s|\\S]*?<\\/audio>/', $content, $audio_list);
     preg_match_all('/<ul [\\s|\\S]*?<\\/ul>/', $content, $title_list);
     preg_match_all('/<li [\\s|\\S]*?<\\/li>/', $title_list[0][0], $title_list);
     $audio_list = array_pop($audio_list);
     $title_list = array_pop($title_list);
     $r = array();
     foreach ($title_list as $k => $v) {
         $title = http::sub_data($v, '>', '<');
         $title = http::remove_n($title);
         $source_audio_url = http::sub_data($audio_list[$k], "src='", "'");
         if ($title && $source_audio_url) {
             $r[$k]['title'] = $title;
             $r[$k]['intro'] = $intro;
             $r[$k]['cover'] = $cover;
             $r[$k]['source_audio_url'] = $source_audio_url;
         }
     }
     return $r;
 }