本文整理汇总了C#中Tweet.PopulateExtendedData方法的典型用法代码示例。如果您正苦于以下问题:C# Tweet.PopulateExtendedData方法的具体用法?C# Tweet.PopulateExtendedData怎么用?C# Tweet.PopulateExtendedData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tweet
的用法示例。
在下文中一共展示了Tweet.PopulateExtendedData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateStatus
public void UpdateStatus(string statusText, string screenname = null, bool processStatus = true)
{
if (string.IsNullOrEmpty(screenname)) screenname = UsersCollection.PrimaryUser().TwitterScreenName;
var status = GetAuthorizedTwitterContext(screenname).UpdateStatus(statusText);
if (processStatus)
{
status = TwitterModel.Instance.GetAuthorizedTwitterContext(screenname)
.Status
.Where(s => s.StatusID == status.StatusID && s.ScreenName == screenname && s.IncludeEntities == true && s.Type == StatusType.User && s.Count == 1)
.ToList().FirstOrDefault();
if (status != null)
{
var tweet = new Tweet(status);
tweet.PopulateExtendedData();
Repository<Tweet>.Instance.Save(screenname + TWEETS, tweet);
}
}
}
示例2: SendTweet
private bool SendTweet(Tweet tweet, bool isRetweet)
{
var friendsAndFollows = PrimaryTweep.Followers().Select(x => x.ID);
string[] ignore = (ConfigurationManager.AppSettings["Ignore"] ?? "").ToLower().Split(',');
if (!SimulationMode)
{
tweet.PopulateExtendedData();
var link = tweet.Links.OrderByDescending(x => x.ShareCount).FirstOrDefault();
if (link != null &&
ignore.Where(x => link.Title.ToLower().Contains(x)).Count() == 0 && //Cant Contain an Ignore Word
(tweet.User.Url == null || !link.Uri.ToString().Contains(tweet.User.Url) || friendsAndFollows.Contains(tweet.User.UserID)) //Can not be from same url as user tweeting this, unless you are a friend
)
{
if (!isRetweet)
{
string statusText = !link.Title.ToLower().StartsWith("http") ?
(link.Title.Length > 116 ? link.Title.Substring(0, 116) : link.Title) + " " + link.Uri.ToString()
:
link.Uri.ToString();
TwitterModel.Instance(PrimaryTweep.ScreenName).UpdateStatus(statusText, processStatus: false);
}
else
TwitterModel.Instance(PrimaryTweep.ScreenName).Retweet(tweet.StatusID);
return true;
}
return false;
}
else
return true;
}