First, let me say what an awsome package this is - I've done stuff with Twitter and oAuth and know how unpleasant it can be, so great work!
I've noticed a small bug in the LatestTweets.xslt macro
You can set the param "numberOfTweetsToDisplay" to a number - which should govern how many tweets are displated. However, if you have also set "includeReplies" and "includeRetweets" to "false" and your feed contains replies and/or retweets then these are removed after the selection is made, rather than before.
So, if you ask for 3 tweets then it gets the first 3 tweets and then removes replies and retweets. So if you're last 3 tweets all happen to be replies then you'd get zero tweets displaying. So it should do pruning before the "take" part of the query.
Unfortunately, that's how the twitter API processes those requests (I just pass the values straight through), so to make it work would require uTwit to pull back way more results than you asked for, and then prune them, hoping there will be enough results left to fulfil your quota, however, even with that it would be possible to not have enough. Ultimately I have just kept it true to the twitter API, so if you need to prune, I would suggest just asking for more than you want, and limit your loop instead.
If enough people see it as an issue, I'll look to address it, but I'd need to check how that will affect performance. In the mean time though, the above should be enough to get it working for you.
To just get the first two. (I'm hoping there won't be loads of replies!)
BTW, noticed another small bug - if a URL is the last part of the tweet then it's not getting "linkified". I'm guessing the regex to "linkify" probaly needs some whitespace after the last character of the URL? I guess just adding a space to the end of the tweet could fix that.
Bringing up an old topic here but I compromised. I called in 20 tweets. Then in the tweet list changed @foreach (var tweet in Model) to @foreach (var tweet in Model.Take(3))
Seems to work unless there is a load of replies and retweets etc.
Tweet Count Bug
First, let me say what an awsome package this is - I've done stuff with Twitter and oAuth and know how unpleasant it can be, so great work!
I've noticed a small bug in the LatestTweets.xslt macro
You can set the param "numberOfTweetsToDisplay" to a number - which should govern how many tweets are displated. However, if you have also set "includeReplies" and "includeRetweets" to "false" and your feed contains replies and/or retweets then these are removed after the selection is made, rather than before.
So, if you ask for 3 tweets then it gets the first 3 tweets and then removes replies and retweets. So if you're last 3 tweets all happen to be replies then you'd get zero tweets displaying. So it should do pruning before the "take" part of the query.
Hi Dan,
Glad you are liking it so far.
Unfortunately, that's how the twitter API processes those requests (I just pass the values straight through), so to make it work would require uTwit to pull back way more results than you asked for, and then prune them, hoping there will be enough results left to fulfil your quota, however, even with that it would be possible to not have enough. Ultimately I have just kept it true to the twitter API, so if you need to prune, I would suggest just asking for more than you want, and limit your loop instead.
If enough people see it as an issue, I'll look to address it, but I'd need to check how that will affect performance. In the mean time though, the above should be enough to get it working for you.
Matt
Hi Matt,
Thanks for the quick reply! If the problem is with the Twitter API itself then I can see that there is nothing you can do, then.
I've already basically come to the conclusion you have, so I'm getting five tweets and then in my XSLT I've used:
<xsl:for-each select="$tweets/status[position()<=2]">
To just get the first two. (I'm hoping there won't be loads of replies!)
BTW, noticed another small bug - if a URL is the last part of the tweet then it's not getting "linkified". I'm guessing the regex to "linkify" probaly needs some whitespace after the last character of the URL? I guess just adding a space to the end of the tweet could fix that.
Hey Dan,
Yea, as I say, if enough people see it as an issue too, I might implement something, but I'd prefer to keep close to the API myself.
Thanks for letting me know about the linking issue, I'll take a look at that when I have a spare few minutes.
Matt
Bringing up an old topic here but I compromised. I called in 20 tweets. Then in the tweet list changed @foreach (var tweet in Model) to @foreach (var tweet in Model.Take(3))
Seems to work unless there is a load of replies and retweets etc.
is working on a reply...