I’m looking for a way to getting linkedin share button stats of a page.
For example, I’m writing a PHP class, when you use my class on your website like this:
include("shareButtonStats.class.php");
$stats = new shareButtonStats;
echo "This page shared " . $stats->show . " times on LinkedIn";
As you can see I need to get that page’s stats for how many times shared .
As you know when we add LİnkedIn’s js file for Share Button (from here), it’s including some HTML codes to our page. Something like this :
<span class="IN-widget" style="line-height: 1; vertical-align: baseline; display: inline-block; text-align: center;">
<span style="padding: 0pt ! important; margin: 0pt ! important; text-indent: 0pt ! important; display: inline-block ! important; vertical-align: baseline ! important; font-size: 1px ! important;">
<span id="li_ui_li_gen_1321370527058_1-container" class="IN-top">
<span id="li_ui_li_gen_1321370527058_1" class="IN-top">
.......
If I get that HTML codes, without including it to page directly, I can use a RegEx over it, and then get share button count 🙂
Have you got any idea for me?
I believe they do and its a simple web page that requires the URL. it returns JSON which either JavaScript or PHP could parse
hope this helps
http://www.linkedin.com/countserv/count/share?url=http://www.apple.com