Skip to content

Commit

Permalink
add fix gplus and fb
Browse files Browse the repository at this point in the history
  • Loading branch information
CB9TOIIIA committed Dec 24, 2016
1 parent 86226ab commit bde2779
Showing 1 changed file with 37 additions and 6 deletions.
43 changes: 37 additions & 6 deletions views/social/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ function rdate($param, $time=0) {

if ($code == 200) {
$body = $response->body;
if (preg_match('/MorePagerFetchOnScroll/', $body, $matchfb)) {
preg_match('/\<span id\="PagesLikesCountDOMID"\>.+PageStructured/', $body, $matchfb);
$matchfb = strip_tags($matchfb['0']);
$matchfb = str_replace('Отметки «Нравится»:','<span class="fbcount">',$matchfb);
if (preg_match('/MorePagerFetchOnScroll/', $body, $matchfb)) {

preg_match('/Нравится(.+?)\<\/span\>\<\/a\>\<\/div\>/', $body, $matchfb1);
$matchfb = strip_tags($matchfb1['0']);

$matchfb = str_replace('Нравится»:','<span class="fbcount">',$matchfb);
$matchfb .= ' </span>';
}
else {
Expand All @@ -157,9 +159,12 @@ function rdate($param, $time=0) {
// var_dump($body);
// echo "</pre>";
if (preg_match('/подписчик/', $body, $matchgplustest) || preg_match('/послідовник/', $body, $matchgplustest) || preg_match('/користувач/', $body, $matchgplustest)) {
preg_match_all('/\<span class\=\"BOfSxb\"\>.+\<span class\=\"DtDbDb\"\>/', $body, $matchgplus);
preg_match_all('/profiles_social_bar(.+?)data-tooltip/', $body, $matchgplus);
dump($body,0,'test');
foreach ($matchgplus as $matchgplusone) {
$matchgplusone = strip_tags($matchgplusone['0']);
$matchgplusone = strip_tags($matchgplusone[0]);
preg_match("/\d{1,10}/", $matchgplusone, $matchgplusoneN);
$matchgplusone = $matchgplusoneN[0];
$matchgplusone = preg_replace('/&.*/', '', $matchgplusone);
$matchgplusone = str_replace(' подписчика','',$matchgplusone);
$matchgplusone = str_replace(' подписчик','',$matchgplusone);
Expand All @@ -182,6 +187,32 @@ function rdate($param, $time=0) {
//dump($body,0,'$body');
//dump($matchgplus,0,'$matchgplus');
}
// if (preg_match('/подписчик/', $body, $matchgplustest) || preg_match('/послідовник/', $body, $matchgplustest) || preg_match('/користувач/', $body, $matchgplustest)) {
// preg_match_all('/\<span class\=\"BOfSxb\"\>.+\<span class\=\"DtDbDb\"\>/', $body, $matchgplus);
// foreach ($matchgplus as $matchgplusone) {
// $matchgplusone = strip_tags($matchgplusone['0']);
// $matchgplusone = preg_replace('/&.*/', '', $matchgplusone);
// $matchgplusone = str_replace(' подписчика','',$matchgplusone);
// $matchgplusone = str_replace(' подписчик','',$matchgplusone);
// $matchgplusone = str_replace(' послідовник','',$matchgplusone);
// $matchgplusone = str_replace(' послідовників','',$matchgplusone);
// $matchgplusone = str_replace(' користувач','',$matchgplusone);
// $matchgplusone = preg_replace('/і.*/', '', $matchgplusone);
// $matchgplusone = preg_replace('/в.*/', '', $matchgplusone);
// $matchgplusone = str_replace('і','',$matchgplusone);
// $matchgplusone = str_replace('в','',$matchgplusone);
// // $matchgplusone = str_replace(' і підписалися','',$matchgplusone);
// // $matchgplusone = str_replace(' підписалися','',$matchgplusone);
// // $matchgplusone = str_replace('підписалися','',$matchgplusone);
// // $matchgplusone = str_replace(' пдписалося','',$matchgplusone);
// // $matchgplusone = str_replace('пдписалося','',$matchgplusone);
// // $matchgplusone = str_replace('і','',$matchgplusone);
// // $matchgplusone = str_replace('в','',$matchgplusone);
// }

// //dump($body,0,'$body');
// //dump($matchgplus,0,'$matchgplus');
// }
else {
$matchgplusone = '-';
}
Expand Down

0 comments on commit bde2779

Please sign in to comment.