Copied to clipboard

Flag this post as spam?

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


  • Pete 213 posts 285 karma points
    Aug 29, 2013 @ 15:33
    Pete
    0

    Value cannot be null

    I get a value cannot be null error using GetUserTweets().

    The keys/tokens are all correct.

    If I use the exact same script on my local server it runs perfectly. I tried 20 different usernames on the live server and it returns blank/null.

    Do I have to add the live server domain to the script or to the twitterapp settings or something?

    How can I get the errorcode that's coming back from twitter api?

    Here's the code:

    @{
       
        int nrOfTweets = String.IsNullOrEmpty(Parameter.nrOfTweets) ? 10 : int.Parse(Parameter.nrOfTweets);

        var t = new uTweets.Tweets();
        @*var result = t.GetTweets();*@
        var result = t.GetUserTweets("yourtwitterusername");
        if (result != null)
        {
            <ul>
                @foreach(var tw in result.Take(nrOfTweets))
                {
                    <li>@(tw.Author): @Html.Raw(tw.TextAsHtml) (@tw.CreatedDate) (@tw.RelativeTime)</li>
                }
            </ul>
        }
       
    }

  • Nick Garrard & Davy Belmans 25 posts 142 karma points
    Sep 16, 2013 @ 16:43
    Nick Garrard & Davy Belmans
    0

    Hi, sorry for the late reply. Did you already find the problem?

    I don't see anything wrong with your code and if it works on your local server, then the code definitely should be fine.

    Do you have the same problem with the other uTweets functions, like GetTweets?

    regards,

    Davy

Please Sign in or register to post replies

Write your reply to:

Draft