T
T
test2602016-03-04 16:15:23
PHP
test260, 2016-03-04 16:15:23

How to parse the registration date of VKontakte?

Here is the code itself:

<?
$url=' vk.com/foaf.php?id= '.$_GET[id];
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_HEADER,1);
curl_setopt($curl,CURLOPT_POST,1);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_USERAGENT,"Opera/10.00 (Windows NT 5.1; U; ru) Presto/2.2.0");
curl_setopt($curl,CURLOPT_FAILONERROR,1);
curl_setopt($curl,CURLOPT_REFERER," vk.com ");
$res = curl_exec($curl);
preg_match_all("#ya:created dc:date=\"(.+?)\"/>#", $res, $match);
$data = $match['1']['0'];
echo $res;
echo'Page registered: '.$data;

echo $res; Returns: HTTP/1.1 302 Moved Temporarily Server: Apache Date: Fri, 04 Mar 2016 13:02:03 GMT Content-Type: text/html Content-Length: 157 Connection: close Location : vk.com/err400.html
could be a problem?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexander Aksentiev, 2016-03-04
@Sanasol

because not https

D
Dmitry, 2016-03-04
@mytmid

print_r( file_get_contents('http://vk.com/foaf.php?id=1') );

Normal HTTP request works fine.

M
Miku Hatsune, 2016-03-04
@Hatsune-Miku

But what about the API?

E
Eugene, 2016-03-04
@Nc_Soft

CURLOPT_FOLLOWLOCATION

S
Sanya Krotov, 2019-06-22
@kollenok

When I need to see the date of registration of any VKontakte page, I go to this site - searchperson.ru
and simply indicate the link to the profile or VKontakte community.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question