mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-27 03:50:42 +03:00
[FB2Bridge] Split long lines
Splits long lines into short sections without using string concatenation (.) to prevent errors due to coding styles.
This commit is contained in:
parent
6f24858124
commit
b4f1dc35a1
1 changed files with 29 additions and 12 deletions
|
@ -154,20 +154,37 @@ EOD;
|
||||||
// Currently not used. Is used to get more than only 3 elements, as they appear on another page.
|
// Currently not used. Is used to get more than only 3 elements, as they appear on another page.
|
||||||
private function computeNextLink($string, $pageID){
|
private function computeNextLink($string, $pageID){
|
||||||
|
|
||||||
$regex = "/timeline_unit\\\\\\\\u00253A1\\\\\\\\u00253A([0-9]*)\\\\\\\\u00253A([0-9]*)\\\\\\\\u00253A([0-9]*)\\\\\\\\u00253A([0-9]*)/";
|
$regex = implode(
|
||||||
|
'',
|
||||||
|
array(
|
||||||
|
"/timeline_unit",
|
||||||
|
"\\\\\\\\u00253A1",
|
||||||
|
"\\\\\\\\u00253A([0-9]*)",
|
||||||
|
"\\\\\\\\u00253A([0-9]*)",
|
||||||
|
"\\\\\\\\u00253A([0-9]*)",
|
||||||
|
"\\\\\\\\u00253A([0-9]*)/"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
preg_match($regex, $string, $result);
|
preg_match($regex, $string, $result);
|
||||||
|
|
||||||
return "https://touch.facebook.com/pages_reaction_units/more/?page_id="
|
return implode(
|
||||||
. $pageID
|
'',
|
||||||
. "&cursor=%7B%22timeline_cursor%22%3A%22timeline_unit%3A1%3A"
|
array(
|
||||||
. $result[1]
|
"https://touch.facebook.com/pages_reaction_units/more/?page_id=",
|
||||||
. "%3A"
|
$pageID,
|
||||||
. $result[2]
|
"&cursor=%7B%22timeline_cursor%22%3A%22timeline_unit%3A1%3A",
|
||||||
. "%3A"
|
$result[1],
|
||||||
. $result[3]
|
"%3A",
|
||||||
. "%3A"
|
$result[2],
|
||||||
. $result[4]
|
"%3A",
|
||||||
. "%22%2C%22timeline_section_cursor%22%3A%7B%7D%2C%22has_next_page%22%3Atrue%7D&surface=mobile_page_home&unit_count=3";
|
$result[3],
|
||||||
|
"%3A",
|
||||||
|
$result[4],
|
||||||
|
"%22%2C%22timeline_section_cursor%22%3A%7B%7D%2C%22",
|
||||||
|
"has_next_page%22%3Atrue%7D&surface=mobile_page_home&unit_count=3"
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Builds the HTML from the encoded JS that Facebook provides.
|
//Builds the HTML from the encoded JS that Facebook provides.
|
||||||
|
|
Loading…
Reference in a new issue