📜 ⬆️ ⬇️

Popular: Site RSS + Facebook Statistics

I usually don’t have enough time to read all the new articles on sites that interest me. And, opening Google Reader, I look at a couple of recent RSS entries and just click “mark all as read.”
Not effective, right? Therefore, I decided to make a natural content popularity filter for myself: the number of people who clicked on it (Facebook audience is more relevant to my interests).

Without thinking for a long time, I wrote a script that parses the RSS from the site and sorts the articles so that the most popular are higher than the rest.


')
And these 50 lines of code have greatly simplified my life - now I just select the site I need (the address of its RSS broadcast) and run the script.
Code and comments on the implementation of the cat.

  1. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  2. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  3. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  4. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  5. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  6. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  7. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  8. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  9. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  10. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  11. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  12. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  13. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  14. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  15. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  16. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  17. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  18. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  19. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  20. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  21. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  22. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  23. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  24. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  25. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  26. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  27. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  28. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  29. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  30. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  31. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  32. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  33. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  34. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  35. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  36. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  37. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  38. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  39. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  40. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  41. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  42. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  43. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>
  44. <?php $url = 'http://www.vedomosti.ru/newspaper/out/rss.xml' ; $FBstat = 'http://api.facebook.com/restserver.php?method=links.getStats&urls=' ; $linkFB = '' ; // rss $rss = simplexml_load_file ( $url ) ; $i = 0 ; foreach ( $rss -> channel -> item as $item ) { $linkFB = $linkFB . $item -> link . ',' ; $FB [ $i ] [ 'title' ] = '<a href="' . $item -> link . '">' . $item -> title . '</a>' ; $FB [ $i ] [ 'description' ] = $item -> description ; $FB [ $i ] [ 'pubDate' ] = $item -> pubDate ; $i ++; } // $rssFB = simplexml_load_file ( $FBstat . $linkFB ) ; $i = 0 ; foreach ( $rssFB -> link_stat as $item ) { $FB [ $i ] [ 'shareFB' ] = $item -> share_count ; $FB [ $i ] [ 'likeFB' ] = $item -> like_count ; $i ++; } // share + like function cmp ( $a , $b ) { $x1 = $a [ "shareFB" ] + $a [ "likeFB" ] ; $x2 = $b [ "shareFB" ] + $b [ "likeFB" ] ; return $x2 - $x1 ; } usort ( $FB , "cmp" ) ; // echo '<h1>.RU</h1>' ; reset ( $FB ) ; foreach ( $FB as $abc ) { $stat = 'Shares: ' . $abc [ 'shareFB' ] . ' Likes: ' . $abc [ 'likeFB' ] ; if ( $abc [ 'shareFB' ] != 0 || $abc [ 'likeFB' ] != 0 ) { $stat = '<b>' . $stat . '</b>' ; } echo '<div style="width:400px; margin-top:10px; border:1px dashed #98bf21;">' ; echo '<span style="display:block; font-size:1.2em;">' . $abc [ 'title' ] . '</span>' ; echo '<span style="display:block;">' . $stat . ' ' . $abc [ 'pubDate' ] . '</span>' ; echo '<div style="display:inline-block;">' . $abc [ 'description' ] . '</div>' ; echo '</div>' ; } ?>

Comments
I do not think that the code should be disassembled in detail, but I note that the simplest implementation has the following disadvantages:
  1. It is imperative to check which URL is “fumbled” on the site and compare it with that obtained in XML. Even the register is important, that is, for Facebook? DocID = and? Docid = will be different URLs.

  2. Very often, the number of item in RSS is limited, so if you do not periodically save all the data in the database, you will only receive statistics on the current data from the RSS.

  3. To optimize the time statistics for all links is requested for one request. It is possible to go beyond the number of valid characters in the URL. A better way is to group them and check the length (just don’t ask for each URL separately - Facebook doesn’t work so fast).
For example, I wrote styles right in the code, I understand that this is bad. But the fact that Facebook via the API sends data to UTF-8 and SimpleXML in PHP is also good.

Check how the script works here .

And honestly, I like the way the Facebook API works via Javascript. But getting external XML and parsing it turned out to be more difficult for me than implementing on the server side. If you tell me how to get and parse external XML data through Javascript, I will be very grateful.

Source: https://habr.com/ru/post/116702/


All Articles