人気:RSSサイト+ Facebook統計

通常、興味のあるサイトのすべての新しい記事を読む時間はありません。 また、Googleリーダーを開くと、最新のRSSフィードをいくつか見て、「すべて既読にする」をクリックします。
効果的ではありませんか? そのため、私は自分自身でコンテンツの人気の自然なフィルターを作成することにしました。それは好きな人の数です(Facebookの視聴者は私の興味により関連しています)。

長い間考えずに、サイトからRSSを解析し、最も人気のある記事が他の記事よりも高くなるように記事を並べ替えるスクリプトを作成しました。



そして、これらの50行のコードは私の人生を大幅に簡素化しました。今、必要なサイト(RSSフィードのアドレス)を選択して、スクリプトを実行するだけです。
猫の下での実装に関するコードとコメント。

  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>' ; } ?>

コメント
コードを詳細に分析する必要はないと思いますが、最も単純な実装には次の欠点があることに注意してください。
  1. どの特定のURLがサイトで機能していないかを確認し、XMLで受信したURLと比較することが不可欠です。 大文字と小文字を区別することも重要です。つまり、FacebookではDocID =とDocid =は異なるURLになります。

  2. 非常に多くの場合、RSSのアイテムの数は限られているため、データベースにすべてのデータを定期的に保存しないと、RSSから現在のデータの統計のみが取得されます。

  3. 時間を最適化するために、すべてのリンクの統計が単一の要求で要求されます。 URLの有効な文字数を超えることは可能です。 より正確な方法は、それらをグループ化し、長さをチェックすることです(各URLを個別に要求しないでください-Facebookはそれほど速く動作しません)。
たとえば、コードにスタイルを直接記述しましたが、これは悪いことだと理解しています。 しかし、良いニュースは、FacebookがAPIを介してUTF-8のデータとPHPのSimpleXMLを提供することです。

ここでスクリプトの動作を確認できます

そして正直に言うと、私はJavaScriptを介したFacebook APIの機能がより好きです。 しかし、外部XMLを取得して解析することは、サーバー側の実装よりも難しい作業であることがわかりました。 Javascriptを介して外部XMLデータを取得および解析する方法を教えていただければ、とても感謝しています。

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


All Articles