W
W
w_b_x2016-10-03 11:54:01
PHP
w_b_x, 2016-10-03 11:54:01

Parsing an authorized FaceBook page - how?

Good day!
There is a Facebook page created by me; There are its settings and notifications that are visible only to me.
It is vital to parse these notifications into my service and display them in the interface.
The actual attempts were as follows:

include_once("simple_html_dom.php"); // Подключаю библиотеку чтобы парсить
$url2 = 'https://www.facebook.com/***/settings/?tab=notifications'; // URL для парсинга
$context2 = stream_context_create(array('http' => array('header' => 'User-Agent: Mozilla compatible \r\n' .
              'Cookie: datr=***;c-user=***;xs=***;fr=***;csm=2;s=***;pl=n;lu=***;p=-2; presence=***;\r\n'))); // Закидываю куки и UserAgent
$response2 = file_get_contents($url2, false, $context2); // Получаю страницу
$html2 = str_get_html($response2); // Разбиваю страницу на элементы

foreach($html2->find('a') as $element2){
       echo $element2->href . "<br>"; // Вывожу все ссылочки
     }

But to my deepest regret - facebook does not authorize me and does not return the page, but instead offers to enter - so my old-fashioned way did not work.
PS I took all cookies through Mozilla (I looked at what the browser sends when receiving data).
Help out with advice (and if it's not a pity for the code) what should I do here?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question