• Resolved ScreenRes

    (@screenres)


    I have tweets from 1 twitter account being fetched.
    Item count in rule is set to 4 but only 3 are returned.
    I’ve tried increasing the count to 10 but when I do only 7 tweets are returned.

    This happens with both the default templates (plain and debug) and my custom template.

    Replies and re-tweets are both excluded.
    Cache is at default (1200).

    Fetch Tweets version 2.6.0

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Hi,

    It seems to be due to how the Twitter API responds.

    According to their documentation of the count parameter,

    Specifies the number of Tweets to try and retrieve, up to a maximum of 200 per distinct request. The value of count is best thought of as a limit to the number of Tweets to return because suspended or deleted content is removed after the count has been applied. We include retweets in the count, even if include_rts is not supplied. It is recommended you always send include_rts=1 when using this API method.

    We include retweets in the count, even if include_rts is not supplied

    This part in particular says the count you specify may not match the count of actual retrieved tweets.

    However, I agree that this is not intuitive. I’ll think about how this can be avoided. Maybe an option can be added that allows the user decides whether to fetche the maximum number of tweets that the API allows then the plugin just truncates them by the set count.

    Thanks for reporting the issue.

    Thread Starter ScreenRes

    (@screenres)

    Thanks for the response @miunosoft.
    The feed I was pulling in did have several re-tweets in it.

    Not sure if this will help but I’ve been testing a few bits my end.
    I updated to v2.6.0 from v2.4.9 so went back and downloaded v2.5.0 through to v2.5.3, this issues started in v2.5.0. I had a look at the change log and reverted 1 change from v2.5.0:

    Default value of the operator argument to IN from AND used when fetching tweets with tags.

    include/class/option/FetchTweets_Option_Format.php
    I changed it back to AND and the issue now isn’t there (returns full item count) in v2.5.0 through to v2.6.0.

    I’m not sure if this affects anything else within the plugin (didn’t do a robust test).
    Would it be feasible to alter it back to AND in v2.6.1 as a temp fix? I understand you must have changed it for a good reasons in v2.5.0.

    Thanks

    Plugin Author miunosoft

    (@miunosoft)

    Hi,

    I changed it back to AND and the issue now isn’t there (returns full item count) in v2.5.0 through to v2.6.0.

    Unless you are showing tweets with tags (the plugin custom taxonomy), it won’t change anything. If you see counts are corrected by changing it like so, you must be pulling tweets with tags. Otherwise, you must be seeing the result of v2.4.x or below.

    v2.4.x or below has the mechanism that fetches tweets with the allowed maximum number and truncates them after that. So the resulted count is likely match the set count. v2.5.0 or above changed the workflow in order to avoid a problem of reaching the max_allowed_packet value of MySQL since it enhanced the ability to load media elements which tend to exceed 1mb for each response from the Twitter API. And 1mb is usually the default value set by most hosts.

    So I said in the previous reply that the option for it may be added and it is the most realistic solution I can currently think of.

    As for a temporary fix, since you say you are using a custom template, if you are comfortable with adding some code to your template, I can suggest something. Let me know if you like to do so.

    Thread Starter ScreenRes

    (@screenres)

    Cheers for the info @miunosoft.

    For the time being I’ve rolled back to v2.4.9.
    Any suggestions on fix via my custom template would be greatly appreciated.

    Thanks

    Plugin Author miunosoft

    (@miunosoft)

    Hi,

    I’ve written a small plugin that should fix the problem so you don’t need to modify your template.

    In the following page of the link, at the top right corner, there is a download link where you can download the plugin.

    Hope it helps.

    Thread Starter ScreenRes

    (@screenres)

    Thanks @miunosoft
    Works perfectly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Item count and returned tweets don’t match’ is closed to new replies.