I've just installed this package and cannot get any results back. I am guessing that I don't have something configured properly somewhere, but what it might be I have no idea.
I've done a little debugging of the XSLT to try to pinpoint the problem. When I add in the following output to the default xslt:
<xsl:choose> <xsl:when test="$displayReplies = 1"> <xsl:value-of select="$twitterXMLUrl"/>: Showing replies <!-- Just show user's tweets only and display @replies --> <xsl:for-each select="umbraco.library:GetXmlDocumentByUrl($twitterXMLUrl)//statuses/status"> <!-- Check that we only show the number of tweets we want --> <xsl:if test="position() <= $noStatus"> <xsl:apply-templates mode="tweet" select="current()"/> </xsl:if> </xsl:for-each> </xsl:when> <xsl:when test="$displayReplies = 0"> <xsl:value-of select="$twitterXMLUrl"/>: NOT showing replies <!-- Just show user's tweets only and DONT display @replies --> <xsl:for-each select="umbraco.library:GetXmlDocumentByUrl($twitterXMLUrl)//statuses/status [in_reply_to_screen_name = '']"> <!-- Check that we only show the number of tweets we want --> <xsl:if test="position() <= $noStatus"> <xsl:apply-templates mode="tweet" select="current()"/> </xsl:if> </xsl:for-each> </xsl:when> </xsl:choose>
I get the proper message regarding Twitter username and reply flag. So I know that xsl:when test condition is being met. So then I try another little output test:
<xsl:choose> <xsl:when test="$displayReplies = 1"> <!-- Just show user's tweets only and display @replies --> <xsl:for-each select="umbraco.library:GetXmlDocumentByUrl($twitterXMLUrl)//statuses/status"> Test <!-- Check that we only show the number of tweets we want --> <xsl:if test="position() <= $noStatus"> <xsl:apply-templates mode="tweet" select="current()"/> </xsl:if> </xsl:for-each> </xsl:when> <xsl:when test="$displayReplies = 0"> <!-- Just show user's tweets only and DONT display @replies --> <xsl:for-each select="umbraco.library:GetXmlDocumentByUrl($twitterXMLUrl)//statuses/status [in_reply_to_screen_name = '']"> <!-- Check that we only show the number of tweets we want --> Test <xsl:if test="position() <= $noStatus"> <xsl:apply-templates mode="tweet" select="current()"/> </xsl:if> </xsl:for-each> </xsl:when> </xsl:choose>
And nothing is displayed. I would expect to see the word "Test" output the number of times specified in my noStatus parameter.
Therefore I expect the xsl:for-each is counting to zero and breaking. Anything in the umbraco.library or $twitterXMLUrl variable that could be causing this?
It seems like it *is* working, but only sporadically. Sometimes visiting the page will yield blank results, other times I get the expected list of tweets.
This is an intranet site, being built on Umbraco 4.5.0. I set the macro to "Use in editor", but other than that I have made no modifcations. I have added it to a page with the following settings:
This is the instance that works only intermittently. However, I only made the "Use in editor" switch recently. Before that I put the macro directly in my template like so:
And had the exact same problem. This problem persisted even when I set twitterUsername="warrenbuckley".
2. Public (Works fine)
This project (unrelated to the first) is being built on Umbraco 4.0.3. I have made extensive modifications to the XSLT on this one, but have not set "Use in editor". I only use this version directly in my template:
Hello Alex, It is strange one version is working perfectly fine and the other is not.
I am wondering if you are using slightly different version of Twitter for Umbraco.
If you goto this line and check it now reads like this, main difference from this latest version below and older versions is that I am requesting the max number of tweets at 200 and filtering them further down. Where
<!-- Twitter XML URL --> <xsl:variablename="twitterXMLUrl"select="concat('http://twitter.com/statuses/user_timeline/', $twitterUsername ,'.xml?count=200')"/>
Have you tried any form of caching to see this helps the problem?
Also recently the Twitter API has been having problems and I wonder if this is part of the problem, if so I think we would need to look at caching the XML from twitter so that we can always use it.
Hi Warren, the line you provided is in both of my implementations. I downloaded the package just last week and installed it simultaneously on both sites.
I can verify (through some debugging) that when the page is showing up blank, it's because
Hiya Alex, I am quite relieved to hear it was a problem with the API rather than my code, as it really had my head scratching on what the problem could be.
I modified the XSL to include a "graceful failure" when the API is unresponsive. This is not as ideal as it would be to 1) cache the feed and 2) use the most recently cached version for display when the feed is unresponsive. Someone with a deeper knowledge than I would have to provide help with that.
Anyway here's what I'm doing:
<xsl:template match="/">
<!-- Twitter XML URL --> <xsl:variable name="twitterXMLUrl" select="concat('http://twitter.com/statuses/user_timeline/', $twitterUsername ,'.xml?count=200')"/>
Hello Barney, Yes unfortunately the Twitter API is a bit unreliable at times. What Alex has suggested is a good suggestion for an easy fix.
But as Alex suggested you need proper caching, so I can recommend you use Darren Ferguson's FeedCache package which will go off and download the same XML to a local file in your umbraco site, but it will require tweaking and updating the twitter XSLT file to support it.
If you both require this as a feature, create an item/feature request on the Twitter 4 Umbraco codplex project site http://twitter4umbraco.codeplex.com
Sorry to resurect this thread but I've found it very helpful so far. I'm very new to Umbraco (and .Net for that matter) and I've been having exactly the same issues as these with the latest release on the WebMatrix platform (umbraco v 4.7.1 (Assembly version: 1.0.4281.20201) & 1.6 of the Twitter package).
I've got the error message popping up nicely (thanks Alex!) and I've added your error capture which returns the following:
Interestingly I've tried this off the corporate network with the same results so I'm not sure if it's misleading. Unfortunately I have zero experience to date so any help you can offer with this brilliant addition would be welcome!
Tweets not displaying...
I've just installed this package and cannot get any results back. I am guessing that I don't have something configured properly somewhere, but what it might be I have no idea.
I've done a little debugging of the XSLT to try to pinpoint the problem. When I add in the following output to the default xslt:
I get the proper message regarding Twitter username and reply flag. So I know that xsl:when test condition is being met. So then I try another little output test:
And nothing is displayed. I would expect to see the word "Test" output the number of times specified in my noStatus parameter.
Therefore I expect the xsl:for-each is counting to zero and breaking. Anything in the umbraco.library or $twitterXMLUrl variable that could be causing this?
Ok to make it more complicated...
It seems like it *is* working, but only sporadically. Sometimes visiting the page will yield blank results, other times I get the expected list of tweets.
Anyone have thoughts on what it could be?
Hello Alex,
What settings do you have set for the macro please?
Warren
I am using the macro on two different websites:
1. Intranet (Buggy)
This is an intranet site, being built on Umbraco 4.5.0. I set the macro to "Use in editor", but other than that I have made no modifcations. I have added it to a page with the following settings:
This is the instance that works only intermittently. However, I only made the "Use in editor" switch recently. Before that I put the macro directly in my template like so:
And had the exact same problem. This problem persisted even when I set twitterUsername="warrenbuckley".
2. Public (Works fine)
This project (unrelated to the first) is being built on Umbraco 4.0.3. I have made extensive modifications to the XSLT on this one, but have not set "Use in editor". I only use this version directly in my template:
This one has never given me any problems.
Hello Alex,
It is strange one version is working perfectly fine and the other is not.
I am wondering if you are using slightly different version of Twitter for Umbraco.
If you goto this line and check it now reads like this, main difference from this latest version below and older versions is
that I am requesting the max number of tweets at 200 and filtering them further down. Where
Have you tried any form of caching to see this helps the problem?
Also recently the Twitter API has been having problems and I wonder if this is part of the problem, if so I think we would need to look at caching the XML from twitter so that we can always use it.
Warren :)
Hi Warren, the line you provided is in both of my implementations. I downloaded the package just last week and installed it simultaneously on both sites.
I can verify (through some debugging) that when the page is showing up blank, it's because
is empty.
Can you point me to any resources on how to do some caching?
When this site is intermittly having issues. Please check this URL is returning any results.
http://twitter.com/statuses/user_timeline/Username.XML?count=200
When you are viewing the page in your browser, are you forcing a refresh?
eg CTRL + F5
When viewing in FireFox with FireBug. Does any markup get generated?
Have you tried changing the macro setting to match that of the working site?
Does this then work?
Another idea you could try is to do the following. So we can see the XML feed we are getting from twitter.
Let me know what this returns please.
When the issue occurs, the code above returns nothing. Then when I visit http://twitter.com/statuses/user_timeline/Username.XML?count=200 (using the proper username) I see nothing. Therefore I am guessing this has to do with the Twitter API.
I've added this message before the <xsl:choose> element to at least handle this error somewhat:
Thanks for your help! At least I know I'm not crazy.
Hiya Alex,
I am quite relieved to hear it was a problem with the API rather than my code, as it really had my head scratching on what the problem could be.
Warren :)
I keep getting this too. Seems Twitter is pretty unstable at the moment.
Could some one explain how to add this failsafe to display a message if Twitter is unavailble?
Many thanks,
Barney
Hi Barney,
I modified the XSL to include a "graceful failure" when the API is unresponsive. This is not as ideal as it would be to 1) cache the feed and 2) use the most recently cached version for display when the feed is unresponsive. Someone with a deeper knowledge than I would have to provide help with that.
Anyway here's what I'm doing:
Hello Barney,
Yes unfortunately the Twitter API is a bit unreliable at times. What Alex has suggested is a good suggestion for an easy fix.
But as Alex suggested you need proper caching, so I can recommend you use Darren Ferguson's FeedCache package which will go off and download the same XML to a local file in your umbraco site, but it will require tweaking and updating the twitter XSLT file to support it.
If you both require this as a feature, create an item/feature request on the Twitter 4 Umbraco codplex project site
http://twitter4umbraco.codeplex.com
http://twitter4umbraco.codeplex.com/workitem/list/basic
Warren :)
Sorry to resurect this thread but I've found it very helpful so far. I'm very new to Umbraco (and .Net for that matter) and I've been having exactly the same issues as these with the latest release on the WebMatrix platform (umbraco v 4.7.1 (Assembly version: 1.0.4281.20201) & 1.6 of the Twitter package).
I've got the error message popping up nicely (thanks Alex!) and I've added your error capture which returns the following:
<error url=" http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=BrizzleRocker&include_rts=true&count=200">System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
at System.Net.HttpWebRequest.GetResponse()
at umbraco.library.GetXmlDocumentByUrl(String Url)</error>
Interestingly I've tried this off the corporate network with the same results so I'm not sure if it's misleading. Unfortunately I have zero experience to date so any help you can offer with this brilliant addition would be welcome!
Any idea's please?
Andrew
is working on a reply...