Change in Twitter API? tweet user list stopped w

2019-05-26 13:53发布

I have the following code I was using to display a list of tweets from select users. Today it stopped showing tweets for the user list here, and is showing tweets from any user's tweet that include the query I set in the parameters. Has there been an update to Twitter API that I am not aware of?

jQuery(function ($) {
    $(".tweet").tweet({
        username: ['user1', 'user2', 'user3'],
        page: 1,
        avatar_size: 32,
        count: 9000,
        query: "@mysearchterm OR #mysearchterm",
        loading_text: "loading ..."
    }).bind("loaded", function () {
        var ul = $(this).find(".tweet_list");
        var ticker = function () {
            setTimeout(function () {
                ul.find('li:first').fadeIn("fast").animate({
                    marginTop: '70px'
                }, 500, function () {
                    $(this).detach().hide().appendTo(ul).fadeIn("fast").removeAttr('style');
                });
                ticker();
            }, 5500);
        };
        ticker();
    });
});
});

1条回答
The star\"
2楼-- · 2019-05-26 15:01

Neither credible nor official, but since you have no answers at all...
I assume that you are using the plugin jquery.tweet.js from seaofclouds (tweet.seaofclouds.com/ or https://github.com/seaofclouds/tweet).
Since a very old commit (Feb 06, 2010), the username option is ignored if you set the query option (see the function build_api_url in jquery.tweet.js). To do what you want you need to append the users to the query string, something like

query: "@mysearchterm OR #mysearchterm OR from:user1 OR from:user2 OR from:user3"

See this JSFiddle.

查看更多
登录 后发表回答