Last active
October 2, 2019 14:50
-
-
Save mloza/8e3b4718d3d0b2d73c733e4b264af4fc to your computer and use it in GitHub Desktop.
Kod do postu o zliczaniu facebookowych like http://blog.mloza.pl/zliczanie-facebookowych-like-lubie-to-przy-pomocy-php/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$source_url = 'http://blog.mloza.pl'; | |
$url = "http://api.facebook.com/restserver.php?method=links.getStats&urls=".urlencode($source_url); | |
$xml = file_get_contents($url); $xml = simplexml_load_string($xml); | |
$shares = $xml->link_stat->share_count; // Liczba share | |
$likes = $xml->link_stat->like_count; // Liczba like | |
$comments = $xml->link_stat->comment_count; // Liczba komentarzy | |
$total = $xml->link_stat->total_count; // Sumarycznie | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment