Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Richard Shaw 11 posts 31 karma points
    Sep 09, 2010 @ 12:49
    Richard Shaw
    0

    Tweets not displaying (2)

    Hello all. I have read the other topic (http://our.umbraco.org/projects/website-utilities/twitter-for-umbraco/help/10937-Tweets-not-displaying-) but my problem seems to have a different cause.

    I'm running Umbraco 4.0.3 with Twitter for Umbraco 1.6 which I installed from the online repository.

    I followed the same debugging process as in the other topic and tried Warren's suggestion of adding...

    <textarea>
     
    <xsl:copy-of select="umbraco.library:GetXmlDocumentByUrl($twitterXMLUrl)" />
    </textarea>

    which showed me the following error message:

    <error url="http://twitter.com/statuses/user_timeline.xml?screen_name=adlsmartcare&include_rts=1&count=200">System.Net.WebException: 
    The remote server returned an error: (400) Bad Request.
    at System.Net.HttpWebRequest.GetResponse()
    at umbraco.library.GetXmlDocumentByUrl(String Url)</error>


    and

    <error url="http://twitter.com/statuses/user_timeline.xml?screen_name=adlsmartcare">System.Net.WebException:
    The remote server returned an error: (400) Bad Request.
    at System.Net.HttpWebRequest.GetResponse()
    at umbraco.library.GetXmlDocumentByUrl(String Url)</error>

    Could there be something wrong with or my core Umbraco installation? Has anyone else encountered this problem?

    Richard

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 09, 2010 @ 12:58
    Warren Buckley
    0

    Hello Richard,
    I am not an ASP.NET expert but I think it may be down to something with the site on your webserver.

    Is your site running locally on your machine on a webserver currently?

    I think it is something along the line that it can not connect to the URL
    http://twitter.com/statuses/user_timeline.xml?screen_name=adlsmartcare&include_rts=1&count=200">http://twitter.com/statuses/user_timeline.xml?screen_name=adlsmartcare&include_rts=1&count=200

    The twitter API does not seem to be having a problem as I can see the list of tweets from the URL.

    Let me know re your umbraco site setup please.

    Thanks,
    Warren :)

  • Richard Shaw 11 posts 31 karma points
    Sep 09, 2010 @ 13:08
    Richard Shaw
    0
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 09, 2010 @ 13:14
    Warren Buckley
    0

    Hello Richard,
    Do you have Remote Desktop Access to the server?

    If so can you open a web browser on the server and confirm you can connect to either of these URLs

    http://twitter.com/statuses/user_timeline.xml?screen_name=adlsmartcare
    http://twitter.com/statuses/user_timeline.xml?screen_name=adlsmartcare&include_rts=1&count=200

    Warren :)

  • Richard Shaw 11 posts 31 karma points
    Sep 09, 2010 @ 14:17
    Richard Shaw
    0
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 09, 2010 @ 14:20
    Warren Buckley
    0

    Hi Richard,
    OK so they may have some kind of external nternet connection from their web server possibly

    Warren :)

  • Richard Shaw 11 posts 31 karma points
    Sep 09, 2010 @ 14:52
    Richard Shaw
    0
  • Ravi Motha 290 posts 500 karma points MVP 7x c-trib
    Sep 09, 2010 @ 16:17
    Ravi Motha
    0

    I had a similar issue with a outbound request to a 3d party web service. I'd start by checking that you have all the correct user credentials for the request.

  • Richard Shaw 11 posts 31 karma points
    Sep 09, 2010 @ 16:39
    Richard Shaw
    0
  • Richard Shaw 11 posts 31 karma points
    Sep 10, 2010 @ 12:03
    Richard Shaw
    0
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 10, 2010 @ 12:21
    Warren Buckley
    0

    Hello Richard you are free to modify the XSLT to work like this if you wish, but I don't recommend it and I won't be able to help you if you customise it to work this way.

    However I think you misunderstand what the variable noStatus is for. As I don't understand why you would set it to 0? Why would you include a twitter macro in your template to show no tweets. Can you tell me why you have set it to 0 and not a value like 5, 10, or 1 ?

    Also you should not modify the XSLT directly especially the variables really, as they get the values from the macro parameters. For example when you use the macro in your template noStatus gets it value from the noStatus macro parameter. So in the example below it grabs the number 30

    <umbraco:Macro twitterUsername="adlsmartcare" noStatus="30" displayReplies="1" displayNativeRTs="1" displayMaps="1" zoom="15" size="400x400" mapType="roadmap" Alias="CWS_twitter" runat="server"></umbraco:Macro>

     

    But you should not need to modify the XSLT, unless you want to modify the markup like my documentation on my our.umbraco.org project page states.
    http://our.umbraco.org/projects/website-utilities/twitter-for-umbraco

    So I recommend you reset the XSLT back to the way it was when the package was installed and set the value of noStatus via the macro parameter to a positive number.

    Let me know how you get on,
    Warren :)

     

  • Ravi Motha 290 posts 500 karma points MVP 7x c-trib
    Sep 10, 2010 @ 12:24
    Ravi Motha
    0

    this doesn't look like a permissions issue from that.. but more a format of the return value.

    <xsl:template match="status" mode="tweet"> 

    This may be an issue with multiple return values rather than a single value

    mode=tweet implies a single result, whereas mode =  array  is multiple tweets

  • Richard Shaw 11 posts 31 karma points
    Sep 10, 2010 @ 12:42
    Richard Shaw
    0

     

     

     

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 10, 2010 @ 12:47
    Warren Buckley
    0

    I personally still don't understand why it is causing the problem? Did you try my suggestion of creating a NEW xslt file and using the umbraco.library:GetXMLDocumentByURL() call?

    I would like to know what the outcome is please, when you try the example in this WIKI page to grab items from BBC News:
    http://our.umbraco.org/wiki/reference/umbracolibrary/getxmldocumentbyurl

    Thanks,
    Warren

  • Ravi Motha 290 posts 500 karma points MVP 7x c-trib
    Sep 10, 2010 @ 13:06
    Ravi Motha
    0

    Hi Richard,

    since you have literally reimplemented the install can you have you tried the standard implementation as suggested by Warren, and can you let us know what the result of that is.

     

     

  • Richard Shaw 11 posts 31 karma points
    Sep 10, 2010 @ 13:18
    Richard Shaw
    0
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 10, 2010 @ 13:28
    Warren Buckley
    0

    Hey Richard,
    The XSLTExtensions config file should something like this

    Before version 4.5.X

    <?xml version="1.0" encoding="utf-8"?>
    <XsltExtensions>
      <ext assembly="/bin/CWS.Twitter4Umbraco.XSLTExtensions" type="CWS.Twitter4Umbraco.XSLTExtensions" alias="CWS.Twitter">
      </ext>
    </XsltExtensions>

    Version 4.5.X and newer

    <?xml version="1.0" encoding="utf-8"?>
    <XsltExtensions>
      <ext assembly="CWS.Twitter4Umbraco.XSLTExtensions" type="CWS.Twitter4Umbraco.XSLTExtensions" alias="CWS.Twitter">
      </ext>
    </XsltExtensions>

    But please can you answer my question in regards to the example BBC News GetXMLDocumentByUrl()
    http://our.umbraco.org/wiki/reference/umbracolibrary/getxmldocumentbyurl

    Thanks,
    Warren


  • Richard Shaw 11 posts 31 karma points
    Sep 10, 2010 @ 13:39
    Richard Shaw
    0
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 10, 2010 @ 13:48
    Warren Buckley
    0

    Hey Richard,
    OK that helps us know there is no problem with the GetXMLDocumentByUrl() call.

    What was your findings in regards to the XSLTExtensions config ?

    Can you copy and paste the macro you have used in the template, so I can see all the properties you have used please.

    In addition to this update the XSLT for me to include this useful debugging please:

    Below this line

    <!-- Twitter XML URL -->
    <xsl:variable name="twitterXMLUrl" select="concat(' http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=', $twitterUsername ,'&amp;include_rts=', $displayNativeRTs ,'&amp;count=200')"/>

    Add this piece of code:

    <xsl:variable name="remoteXML" select="umbraco.library:GetXmlDocumentByUrl($twitterXMLUrl)" />

    <textarea>
        <xsl:copy-of select="$remoteXML" />
    </textarea>

    This in theory should output the XML from the remote URL such as this
    http://api.twitter.com/1/statuses/user_timeline.xml?include_rts=true&count=200&screen_name=warrenbuckley

    Thanks,
    Warren :)

  • Richard Shaw 11 posts 31 karma points
    Sep 10, 2010 @ 14:24
    Richard Shaw
    0
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 10, 2010 @ 14:26
    Warren Buckley
    0

    Seems like some of the problems you are having is to do with permission problems, as the package should automatically update this file on install and uninstall for you.

    Warren

  • Richard Shaw 11 posts 31 karma points
    Sep 10, 2010 @ 16:26
    Richard Shaw
    0
  • Paul A 133 posts 368 karma points
    Dec 21, 2012 @ 12:54
    Paul A
    0

    I can't read half the replies in this thread but for anyone else with this prob, replace your amperands in the twitter URL like this:

    <xsl:variable name="and"><![CDATA[&]]></xsl:variable>

    <xsl:variable name="twitterXMLUrl" select="concat('http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=', $twitterUsername , $and, 'include_rts=', $displayNativeRTs, $and ,'count=15')"/>


Please Sign in or register to post replies

Write your reply to:

Draft