効果的ではありませんか? そのため、私は自分自身でコンテンツの人気の自然なフィルターを作成することにしました。それは好きな人の数です(Facebookの視聴者は私の興味により関連しています)。
長い間考えずに、サイトからRSSを解析し、最も人気のある記事が他の記事よりも高くなるように記事を並べ替えるスクリプトを作成しました。
そして、これらの50行のコードは私の人生を大幅に簡素化しました。今、必要なサイト(RSSフィードのアドレス)を選択して、スクリプトを実行するだけです。
猫の下での実装に関するコードとコメント。
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
<?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>' ; } ?>
コメント
コードを詳細に分析する必要はないと思いますが、最も単純な実装には次の欠点があることに注意してください。
- どの特定のURLがサイトで機能していないかを確認し、XMLで受信したURLと比較することが不可欠です。 大文字と小文字を区別することも重要です。つまり、FacebookではDocID =とDocid =は異なるURLになります。
- 非常に多くの場合、RSSのアイテムの数は限られているため、データベースにすべてのデータを定期的に保存しないと、RSSから現在のデータの統計のみが取得されます。
- 時間を最適化するために、すべてのリンクの統計が単一の要求で要求されます。 URLの有効な文字数を超えることは可能です。 より正確な方法は、それらをグループ化し、長さをチェックすることです(各URLを個別に要求しないでください-Facebookはそれほど速く動作しません)。
ここでスクリプトの動作を確認できます 。
そして正直に言うと、私はJavaScriptを介したFacebook APIの機能がより好きです。 しかし、外部XMLを取得して解析することは、サーバー側の実装よりも難しい作業であることがわかりました。 Javascriptを介して外部XMLデータを取得および解析する方法を教えていただければ、とても感謝しています。