Hi,I am an Umraco newbie, so I don't know if I am reading your instructions corretly.Under Settings >> Document Types, we have a Master Document type. Under generic properties I have added the new OAuth Twitter property, with a type of Twitter OAuth Data Type, it isn't mandatory.To the Twitter OAuth Data Type I have added our application consumer key/secret as pre-values.When I go to one of our content pages, there is now a Twitter property, which allows me to select one of the pre-values but no "Authorise" linkI added the DataType package from the Umbraco package repository and the web package from the download, as the repository wouldn't let me install it.Any ideas what I am doing wrong?ThanksAlso we are on umbraco version 4.7.1
Do you have a screenshot of what you can actually see in the content editor? The only thing you should see is the authorize link, so not sure what you mean by "it allows you to select one of the prevalues".
I seem to have gotten a little further now. I can see the authorize button but when I press it I just get a 404:
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
I'd probably check to make sure that the requested URL exists in your install (maybe it didn't install correctly) and that you don't have anything preventing it from being accessed.
The callback URL in twitter can be anything, as uTwit passes in a return URL anyways, it's just twitter seems to need one defined, even though you don't use it (weird, I know).
My xslt file compiles in umbraco but when I try and view tweets in my page I just get a parsing error:
Error parsing XSLT file: \xslt\latestTweets.xslt
I get the below using the umbraco stack trace:
An error occurred during a call to extension function 'GetLatestTweets'. See InnerException for a complete description of the error.
An error occurred during a call to extension function 'GetLatestTweets'. See InnerException for a complete description of the error.
at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList1[] args)
at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in D:\Program Files\Codify\Public Website Test\Web\xslt\latestTweets.xslt:line 51
at System.Xml.Xsl.CompiledQuery.Query.
The remote server returned an error: (401) Unauthorized.
The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at DevDefined.OAuth.Consumer.ConsumerRequest.ToWebResponse()
at DevDefined.OAuth.Consumer.ConsumerRequest.ToString()
at Our.Umbraco.uTwit.uTwit.GetLatestTweets(String oauthToken, String oauthTokenSecret, String consumerKey, String consumerSecret, String screenName, Int32 count, Boolean includeReplies, Boolean includeRetweets)
at Our.Umbraco.uTwit.uTwitXslt.GetLatestTweets(String oauthToken, String oauthTokenSecret, String consumerKey, String consumerSecret, String screenName, Int32 count, Boolean includeReplies, Boolean includeRetweets)
401's are almost always down to an issue with your prevalues (your api keys) or not having a callback url. I'd probably recommend re-checking these, making sure you have no hidden spaces added on the end by mistake and try it again.
Ultimately a 401 comes from the twitter API, so it means some twitter setting somewhere isn't set right.
Just thinking actually, if you managed to have the authorize link work, and authenticate an account, the callback / keys should be ok, otherwise that would have failed first.
You could always render out the $config variable in LatestTweets.xslt to see what the stored values is (and comment out the rendering of tweets while you debug). Place something like this after the config variable is declared and see what value is returned.
(I'm actually wondering if you've got the property storing it's value as JSON (defined in the prevalue editor) when it needs to be XML when working with XSLT)
Yay! I have it working. I had authorised it on my homepage, but I also needed to do it directly on the page I was showing the tweets. I thought the master page would be enough.
You could actually change the XSLT so rather than looking up the values on the current page (which it is by default in uTwit in order to keep things simple), use XSLT to grab the value from the root node instead. That way you can authenticate once on the homepage, and use that value / macro anywhere on the site. This is usually how I do it.
I'm having the same problems too. Exactly the same as above. Testing the output on a test page (which has the app authorized on it) but getting the Error parsing XSLT file: \xslt\latestTweets.xslt. The test page has a specific twitter template applied to it just to test the output before finally placing it on the homepage.
I get the below using the umbraco stack trace for the testpage:
------------------------------------------
An error occurred during a call to extension function 'GetLatestTweets'. See InnerException for a complete description of the error. An error occurred during a call to extension function 'GetLatestTweets'. See InnerException for a complete description of the error. at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args) at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList1[] args) at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in D:\Public Website\xslt\latestTweets.xslt:line 51 at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double ) at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)
The remote server returned an error: (401) Unauthorized. The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at DevDefined.OAuth.Consumer.ConsumerRequest.ToWebResponse() at DevDefined.OAuth.Consumer.ConsumerRequest.ToString() at Our.Umbraco.uTwit.uTwit.GetLatestTweets(String oauthToken, String oauthTokenSecret, String consumerKey, String consumerSecret, String screenName, Int32 count, Boolean includeReplies, Boolean includeRetweets) at Our.Umbraco.uTwit.uTwitXslt.GetLatestTweets(String oauthToken, String oauthTokenSecret, String consumerKey, String consumerSecret, String screenName, Int32 count, Boolean includeReplies, Boolean includeRetweets)
-----------------------------------------
The data format is XML & both Conumer Key & Secret for the data type are perfect. The authorise link worked perfectly when setting up the test page & I have a call back url saved in the twitter settings.
The exception shows that you are getting a 401 from Twitter, so it's definately something to do with the credentials. Maybe try writing out the config XML (that gets passed to the GetLatestTweets method) to screen and verify that values are what you are expecting to pass.
Ok, so it looks like it's not finding your value, so can you check the following:
1) The uTwit data type is defined on the document you are displaying it on 2) The value of $twitterOAuthPropertyAlias declared at the top of your XSLT file matches the property alias of your uTwit property on your doc type
No "Authorise" link
Hi,I am an Umraco newbie, so I don't know if I am reading your instructions corretly.Under Settings >> Document Types, we have a Master Document type. Under generic properties I have added the new OAuth Twitter property, with a type of Twitter OAuth Data Type, it isn't mandatory.To the Twitter OAuth Data Type I have added our application consumer key/secret as pre-values.When I go to one of our content pages, there is now a Twitter property, which allows me to select one of the pre-values but no "Authorise" linkI added the DataType package from the Umbraco package repository and the web package from the download, as the repository wouldn't let me install it.Any ideas what I am doing wrong?ThanksAlso we are on umbraco version 4.7.1
Hi Emma,
Do you have a screenshot of what you can actually see in the content editor? The only thing you should see is the authorize link, so not sure what you mean by "it allows you to select one of the prevalues".
Many thanks
Matt
I seem to have gotten a little further now. I can see the authorize button but when I press it I just get a 404:
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /umbraco/plugins/utwit/twitteroauth1callback.aspx
I have something in my call back URL but it perhaps doesn't like it. What sort of thing should it be?
Thanks
Hi Emma,
I'd probably check to make sure that the requested URL exists in your install (maybe it didn't install correctly) and that you don't have anything preventing it from being accessed.
The callback URL in twitter can be anything, as uTwit passes in a return URL anyways, it's just twitter seems to need one defined, even though you don't use it (weird, I know).
Many thanks
Matt
I seem to be getting further.
I am using the xslt files and then calling the below from my template
umbraco:Macro twitterUsername="..." Alias="latestTweets" runat="server"
My xslt file compiles in umbraco but when I try and view tweets in my page I just get a parsing error: Error parsing XSLT file: \xslt\latestTweets.xslt
I get the below using the umbraco stack trace:
An error occurred during a call to extension function 'GetLatestTweets'. See InnerException for a complete description of the error. An error occurred during a call to extension function 'GetLatestTweets'. See InnerException for a complete description of the error. at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args) at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList
1[] args) at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList
1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in D:\Program Files\Codify\Public Website Test\Web\xslt\latestTweets.xslt:line 51 at System.Xml.Xsl.CompiledQuery.Query.The remote server returned an error: (401) Unauthorized. The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at DevDefined.OAuth.Consumer.ConsumerRequest.ToWebResponse() at DevDefined.OAuth.Consumer.ConsumerRequest.ToString() at Our.Umbraco.uTwit.uTwit.GetLatestTweets(String oauthToken, String oauthTokenSecret, String consumerKey, String consumerSecret, String screenName, Int32 count, Boolean includeReplies, Boolean includeRetweets) at Our.Umbraco.uTwit.uTwitXslt.GetLatestTweets(String oauthToken, String oauthTokenSecret, String consumerKey, String consumerSecret, String screenName, Int32 count, Boolean includeReplies, Boolean includeRetweets)
Any ideas what could still be happening? Thanks
Hi Mark,
401's are almost always down to an issue with your prevalues (your api keys) or not having a callback url. I'd probably recommend re-checking these, making sure you have no hidden spaces added on the end by mistake and try it again.
Ultimately a 401 comes from the twitter API, so it means some twitter setting somewhere isn't set right.
Matt
Just thinking actually, if you managed to have the authorize link work, and authenticate an account, the callback / keys should be ok, otherwise that would have failed first.
You could always render out the $config variable in LatestTweets.xslt to see what the stored values is (and comment out the rendering of tweets while you debug). Place something like this after the config variable is declared and see what value is returned.
(I'm actually wondering if you've got the property storing it's value as JSON (defined in the prevalue editor) when it needs to be XML when working with XSLT)
I already have it set to XML, but writing out the config variable doesn't seem to display anything. Do I need to amend anything in the below?
xsl:variable name="config" select="$currentPage/*[local-name() = $twitterOAuthPropertyAlias]/uTwit" /
Thanks
Yay! I have it working. I had authorised it on my homepage, but I also needed to do it directly on the page I was showing the tweets. I thought the master page would be enough.
Thanks for your help
Hi Emma,
Woohoo!
You could actually change the XSLT so rather than looking up the values on the current page (which it is by default in uTwit in order to keep things simple), use XSLT to grab the value from the root node instead. That way you can authenticate once on the homepage, and use that value / macro anywhere on the site. This is usually how I do it.
Many thanks
Matt
Thanks for the tip. I shall give that a go.
Emma
Am I missing something?
I'm having the same problems too. Exactly the same as above. Testing the output on a test page (which has the app authorized on it) but getting the Error parsing XSLT file: \xslt\latestTweets.xslt. The test page has a specific twitter template applied to it just to test the output before finally placing it on the homepage.
I get the below using the umbraco stack trace for the testpage:
------------------------------------------
An error occurred during a call to extension function 'GetLatestTweets'. See InnerException for a complete description of the error. An error occurred during a call to extension function 'GetLatestTweets'. See InnerException for a complete description of the error. at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args) at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList
1[] args) at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList
1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in D:\Public Website\xslt\latestTweets.xslt:line 51 at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double ) at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)The remote server returned an error: (401) Unauthorized. The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at DevDefined.OAuth.Consumer.ConsumerRequest.ToWebResponse() at DevDefined.OAuth.Consumer.ConsumerRequest.ToString() at Our.Umbraco.uTwit.uTwit.GetLatestTweets(String oauthToken, String oauthTokenSecret, String consumerKey, String consumerSecret, String screenName, Int32 count, Boolean includeReplies, Boolean includeRetweets) at Our.Umbraco.uTwit.uTwitXslt.GetLatestTweets(String oauthToken, String oauthTokenSecret, String consumerKey, String consumerSecret, String screenName, Int32 count, Boolean includeReplies, Boolean includeRetweets)
-----------------------------------------
The data format is XML & both Conumer Key & Secret for the data type are perfect. The authorise link worked perfectly when setting up the test page & I have a call back url saved in the twitter settings.
I can't figure this out - Help!!
Hi,
The exception shows that you are getting a 401 from Twitter, so it's definately something to do with the credentials. Maybe try writing out the config XML (that gets passed to the GetLatestTweets method) to screen and verify that values are what you are expecting to pass.
Matt
Thanks Matt
I dropped in
<textarea>
<xsl:copy-of select="$config" />
</textarea>
just after
<xsl:variable name="config" select="$currentPage/*[local-name() = $twitterOAuthPropertyAlias]/uTwit" />
But nothing being displayed (sorry xslt newbie)
Does this sound right?
Ok, so it looks like it's not finding your value, so can you check the following:
1) The uTwit data type is defined on the document you are displaying it on
2) The value of $twitterOAuthPropertyAlias declared at the top of your XSLT file matches the property alias of your uTwit property on your doc type
Many thanks
Matt
Jesus - I'm such a doughball!!!
Right under my nose & I couldn't see it.
ManyThanks Matt
Cheers
Steven
No worries :) Glad you got it working.
Matt
is working on a reply...