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> }
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>
}
}
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
is working on a reply...