Twitter API counter value

I have a feeling that it will be something really simple, but still. I have a code that takes away my latest Twitter statuses - this is pretty much the standard code that everyone uses. However, although the url I am using has added the count parameter ... it does not limit the request to 5 statuses. The code works, well, since it will output 20 statuses instead, just like it is set by default, but I cannot force it to limit the number. What have I done wrong? (I simplified the exit to the body by adding just to make the task easier)

$ (document) .ready (function () {

var username = 'Mynamewouldbehere';
var format = 'json';
var url = 'http://api.twitter.com/1/statuses/user_timeline/'
    + username + '.' + format + '?callback=?&count=5';

$.ajax({
    url: url,
    dataType: "json",
    timeout: 15000,

    success: function(data)
    {
        $.each(data, function(i,item) {
            $("body").append('<p>' + item.text + '</p>');
        });
    }
});
+3
source share
2 answers

& &amp; URL. amp;count count.

+4

'callback =?' , .

0

Source: https://habr.com/ru/post/1743348/


All Articles