1. 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

Discussion in 'XenForo Development Discussions' started by tenants, Apr 3, 2012.

  1. tenants

    tenants Well-Known Member

    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
    both returned nothing, so I don't think XF store these values

    I've seen this information:

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

    tenants Well-Known Member

  3. simbolo

    simbolo Well-Known Member

    tenants likes this.
  4. tenants

    tenants Well-Known Member

    thanks, good to know

    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)
  5. simbolo

    simbolo Well-Known Member

    Yeah, if possible, make sure your caching the responses for your plugin.
  6. simbolo

    simbolo Well-Known Member

    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 likes this.
  7. tenants

    tenants Well-Known Member

    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.
  8. tenants

    tenants Well-Known Member

    I see your point, the same use will likely see the same counts value within 15 minutes
  9. simbolo

    simbolo Well-Known Member

    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.
  10. tenants

    tenants Well-Known Member

    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

    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.

Share This Page