XF 2.2 Show Thread Reply Count on external site on same server

RBM

New member
I have a Xenforo site and a WordPress site install on a single server. I want to add a live reply count of a specific Xenforo thread to a page on the WordPress site. Is there a way to do this without using the RestAPI, as that seems like it would be overkill?
 
There isn't anything built-in to expose something like this, outside of the API.
 
The API method is the way to go anyway, and I wouldn't do that by using the following way, but let's say there was no API.

Every thread page includes structural data in JSON format. And interactionStatistic.userInteractionCount is the total reply count. The HTML page could be read by a script (PHP for example), then <script type="application/ld+json">(.*)</script> is extracted by using simple regex, and it is the JSON string contains the data you need.
 
Back
Top Bottom