0
여기 포도 나무 비디오 예 https://vine.co/v/bjHh0zHdgZT입니다. 어떻게 설명 만 할 수 있습니까?포도 나무 비디오 제목/설명을 얻는 방법?
비디오의 ID가 bjHh0zHdgZT이고 PHP 기반 웹 사이트에 대한 포도 나무 설명이 필요하다고 가정 해 봅시다.
감사합니다.
여기 포도 나무 비디오 예 https://vine.co/v/bjHh0zHdgZT입니다. 어떻게 설명 만 할 수 있습니까?포도 나무 비디오 제목/설명을 얻는 방법?
비디오의 ID가 bjHh0zHdgZT이고 PHP 기반 웹 사이트에 대한 포도 나무 설명이 필요하다고 가정 해 봅시다.
감사합니다.
아마도 페이지의 메타 태그를 구문 분석 할 수 있습니까? 포도 나무 페이지의
출처 :
<meta property="twitter:card" content="player">
<meta property="twitter:title" content="Jethro Ames's post on Vine">
<meta property="twitter:description" content="SquareVine 1 #howto #favthings #loop">
는 file_get_contents와는 preg_match와 PHP의 설명을 취득하려면 : 출력
<?php
$url = "https://vine.co/v/bjHh0zHdgZT";
$data = file_get_contents($url);
preg_match('~<\s*meta\s+property="(twitter:description)"\s+content="([^"]*)~i', $data, $matches);
print_r($matches);
if (isset($matches[2])) {
$description = $matches[2];
}
?>
:
Array
(
[0] => <meta property="twitter:description" content="SquareVine 1 #howto #favthings #loop
[1] => twitter:description
[2] => SquareVine 1 #howto #favthings #loop
)
귀하의 설명을 $ 일치 [2 ]. 이 콘텐츠 (HTML 엔티티, SQL 이스케이프 등)를 제어하는 데주의하십시오. 감사합니다. 대단히 고마워요!
그건 완벽하게 작동합니다! –