2

First time asking here, but after losing my head over this problem for the last days, I had to ask for your help. Basically I need to create the classic social media buttons on a German site, and XING is quite popular there, so I need to do it for it too.

For this project there also needs to be a working counter of the number of shares/likes, and that wasn't a problem for Facebook and Twitter, I just used jQuery to get JSON from graph.facebook.com and urls.api.twitter.com, but XING doesn't seem to have something like that!

On their site they do offer a pre-built Share button just like the others do, and that one has a share counter, but I need to use my custom design.

I even tried to get that default button, hide it and grab the share-counter value to use in my button, but without success, it gives me either UNDEFINED or just nothing.

But I know there must be a way to do it because, for instance, this site does have a working share-counter for XING with a custom style: http://t3n.de/news/recht-homeoffice-620969/

Do you guys have any idea on what I should try?

Ichi Rei
  • 21
  • 2

1 Answers1

0

I've finally managed to do this by parsing the html code from the xing share widget and getting the number from the bubble. (You'll have to do this server-side).

This is the url for the button + count:

https://www.xing-share.com/app/share?op=get_share_button;counter=top;url=your_url_here

You should be able to get the count with the following regexp on the html returned by the above link:

xing-count(.+?)(\d+)(.*?)</span>

The second match will contain the share count.

Radu
  • 126
  • 2
  • 5