Hi, your code does seem to be working. I changed twitteruser to "umbraco" (without @) and I got one tweet from @umbraco.
Does your twitter user have any recent tweets? I read in the twitter api docs that not all tweets can be retrieved with the api. (https://dev.twitter.com/docs/faq#8650) The api will only return the latest (and relevant, whatever that means) tweets for a week or so.
I have an umbraco multi-site instance with multiple twitteraccounts and used the uTweet.ListOfTweets as example for my own code:
@{
int nrOfTweets = String.IsNullOrEmpty(Parameter.nrOfTweets) ? 10 : int.Parse(Parameter.nrOfTweets);
try
{
var t = new uTweets.Tweets();
var username = Model._twitterLink;
var result = t.GetUserTweets(username.ToString());
if (result != null)
{
foreach(var tw in result.Take(nrOfTweets))
{
<div class="tweet">
<p>
@Html.Raw(tw.TextAsHtml)
<span>@tw.CreatedDate</span>
</p>
</div>
}
}
}
catch (Exception ex)
{
@ex.ToString();
}
}
But I'm getting the following error:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'object' does not contain a definition for 'Take'
at CallSite.Target(Closure , CallSite , Object , Int32 )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at ASP._Page_macroScripts_uTweet_ListOfTweets_cshtml.Execute()
How to use GetUserTweets
Thanks for creating this package - very handy :)
I am trying to change the user of the tweets returned in uTweet.LatestTweet.cshtml and am failing.
I have changed the file to this (where twitteruser is the account I want to display tweets from):
I'm not sure how to use the (string screenName) with GetUserTweets .
Hi, your code does seem to be working. I changed twitteruser to "umbraco" (without @) and I got one tweet from @umbraco.
Does your twitter user have any recent tweets? I read in the twitter api docs that not all tweets can be retrieved with the api. (https://dev.twitter.com/docs/faq#8650) The api will only return the latest (and relevant, whatever that means) tweets for a week or so.
regards,
davy
Hi - yes sorry, I forgot to reply, it is working using this:
I was getting an previously when saving before, but now I think it was some kind of server error.
Thanks for the reply - great package :)
I've also a question about GetUserTweets:
I have an umbraco multi-site instance with multiple twitteraccounts and used the uTweet.ListOfTweets as example for my own code:
But I'm getting the following error:
Never mind I've found the solution for my problem:
is working on a reply...