• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Want to retrieve tweets and recommended values for thread

tenants

Well-known member
#1
Hi, i want to extract this information for a plug-in I'm thinking of doing

(ordering posts from certain forums by their tweet count, it will make sense once it's done)

I've had a look around in the database, and I think it's unlikely XF would store these (aren't they retrieve on the fly?
I've searched the infromation schema and
SELECT * FROM `COLUMNS` WHERE `TABLE_NAME` like '%twit%'
SELECT * FROM `COLUMNS` WHERE `TABLE_NAME` like '%tweet%'
both returned nothing, so I don't think XF store these values
)

I've seen this information:
http://johndyer.name/getting-counts...ikesshares-and-google-1-plusones-in-c-or-php/

So I might go away and try something like this unless anyone can suggest a better idea
 

tenants

Well-known member
#4
thanks, good to know

Unauthenticated calls are permitted 150 requests per hour
So I'll have to put some sort of limit on the plug-in to make sure it's not being called too many times (no more than 2 request per minute will prevent this limit being hit)
 

simbolo

Well-known member
#6
You could cache each for 15 min or so for more recently updated threads and the older a thread gets the less ofter the update (hourly / daily / weekly and then at a certain point stop updating).
 

tenants

Well-known member
#7
I was going to get the response every time a user visits a thread (of a particular options-defiend forum),
If it was different than the curret stored value(default 0)... then save the new value...

This way I would have DB access to all the shared values (at least for all the pages that have been visited), and can then order threads by "highest tweeted"

Caching the response wouldn't work here (since I want to know the most up to date value).

I'm still thinking about the design, but since you've mentioned the limit it could be a little harder than 1st thought.
 

tenants

Well-known member
#8
You could cache each for 15 min or so for more recently updated threads and the older a thread gets the less ofter the update (hourly / daily / weekly and then at a certain point stop updating).
I see your point, the same use will likely see the same counts value within 15 minutes
 

simbolo

Well-known member
#9
I see your point, the same use will likely see the same counts value within 15 minutes
The count might be slightly off with a little caching but if they are paging through a thread the api request count would quickly add up without at least minimal caching.
 

tenants

Well-known member
#10
okay... done my 1st version of this...
(still lots to do: performance improvements + recommended/ likes / g+ )

I'm using it to order the events on my forums first page:
Top Shared Upcoming Events

http://www.surreyforum.co.uk/
The idea is that it will make more people tweet there own events (several times)

I'll see if people want it before making it more useable to the general xenforo community and adding it here.