Copied to clipboard

Flag this post as spam?

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


  • manwood 87 posts 109 karma points
    Oct 08, 2010 @ 23:19
    manwood
    0

    Tweets not displaying - The remote server returned an error: (400) Bad Request

    Ok, this is confusing me. The basic problem is tweets not displaying, as others have found. I have taken the XSLT and Umbraco.Library out of it altogether and written a little tool (using the guts of the Umbraco GetXmlDocumentByUrl method) but I'm still getting System.Net.WebException: The remote server returned an error: (400) Bad Request errors. I am calling the Twitter API from an .aspx page. The tool works here from my development environment but not from my server (EUKHost). What was at the root of other people's problems?

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Oct 09, 2010 @ 12:03
    Warren Buckley
    0

    Hello ManWood.
    If it works locally and not on your server I recommend, remote desktoping into the server and checking if you can load up the twitter XML API URL in a browser on the server, to see if it can actually connect to the URL.

    Let me know how that goes first and then we can try and take it from there.

    Thanks,
    Warren :)

  • manwood 87 posts 109 karma points
    Oct 10, 2010 @ 12:35
    manwood
    0

    I can't remote into the server unfortunately and my host are being awkward, claiming it's all third party and not their issue. I have had a cryptic message back from Twitter - they are suggesting using oAuth. I will update when I've had a chance to implement it. I've also written a little code for caching results which you might want to include in your package.

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Oct 11, 2010 @ 12:15
    Warren Buckley
    0

    Hello Manwood.
    The feed that we are using does not require oAuth unless your tweets are protected?
    It is a shame you cannot RDP into the server, have you got another server you can test it with. As the server you are using might have some firewall on it, that prevents it to connecting to the XML URL
    http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=warrenbuckley&include_rts=1&count=200

    Also have yout tried with other twitter user accounts to see if there is any problem there.

    Re caching I know I have forgotton to use caching using the umbraco.library:GetXmlDocumentByUrl call but if you have a better solution for me to update this call I would be happy to know.

    Thanks,
    Warren :)

  • Christopher W. Brandsdal 72 posts 133 karma points
    Feb 14, 2011 @ 15:55
    Christopher W. Brandsdal
    0

    Hi!

    I have the same problem. It throws the error at random. When the error occurs, the twitter URL is still accessable from Firefox.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Feb 14, 2011 @ 16:21
    Dave Woestenborghs
    0

    I had this problem too once and it had to do with the request limit twitter sets. I believe it's 150 request an hour.

    Maybe this link can help :

    http://apiwiki.twitter.com/w/page/22554652/HTTP-Response-Codes-and-Errors

     

  • Christopher W. Brandsdal 72 posts 133 karma points
    Feb 14, 2011 @ 16:22
    Christopher W. Brandsdal
    0

    Just figured that out. What would be the best way to cache this?

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Feb 14, 2011 @ 16:37
    Dave Woestenborghs
    0

    I think caching the macro is the easiest.

  • Christopher W. Brandsdal 72 posts 133 karma points
    Feb 14, 2011 @ 16:39
    Christopher W. Brandsdal
    0

    Testing now with cach at 60 seconds. I think that should do it. Thanks for for helping out. :-)

  • manwood 87 posts 109 karma points
    Feb 14, 2011 @ 22:46
    manwood
    0

    Chris - how do you 'cache a macro'? 

    I wrote a little mod to cache results in ASP.NET, I will post the code when I get a chance (I need to revisit this in the next few days)..

  • Christopher W. Brandsdal 72 posts 133 karma points
    Feb 15, 2011 @ 09:26
    Christopher W. Brandsdal
    1

    Hi, manwood.

    You set the cache properties on the macro in the Macros section under Developer.

Please Sign in or register to post replies

Write your reply to:

Draft