[fb2] Switches to getContents (#742)
This commit is contained in:
parent
0d80a19e84
commit
ead7b2e8de
1 changed files with 5 additions and 5 deletions
|
@ -95,7 +95,7 @@ EOD;
|
||||||
. $pageID
|
. $pageID
|
||||||
. '&cursor={"card_id"%3A"videos"%2C"has_next_page"%3Atrue}&surface=mobile_page_home&unit_count=8';
|
. '&cursor={"card_id"%3A"videos"%2C"has_next_page"%3Atrue}&surface=mobile_page_home&unit_count=8';
|
||||||
|
|
||||||
$fileContent = file_get_contents($requestString);
|
$fileContent = getContents($requestString);
|
||||||
|
|
||||||
$articleIndex = 0;
|
$articleIndex = 0;
|
||||||
$maxArticle = 3;
|
$maxArticle = 3;
|
||||||
|
@ -200,11 +200,11 @@ EOD;
|
||||||
|
|
||||||
//Builds the HTML from the encoded JS that Facebook provides.
|
//Builds the HTML from the encoded JS that Facebook provides.
|
||||||
private function buildContent($pageContent){
|
private function buildContent($pageContent){
|
||||||
|
// The html ends with:
|
||||||
$regex = '/\\"html\\":\\"(.*?)\\",\\"replace/';
|
// /div>","replaceifexists
|
||||||
|
$regex = '/\\"html\\":(\".+\/div>"),"replace/';
|
||||||
preg_match($regex, $pageContent, $result);
|
preg_match($regex, $pageContent, $result);
|
||||||
|
return str_get_html(html_entity_decode(json_decode($result[1])));
|
||||||
return str_get_html(html_entity_decode(json_decode('"' . $result[1] . '"')));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue