public static bool IsRetweetedThis(TwitterStatus status) { if (status == null) return false; var sd = TweetModel.GetExtraData(status).RetweetTable; if (sd == null) return false; var dat = sd.Select((d) => d.Key.ScreenName).ToArray(); return AccountModel.GetAccountElements().Any((d) => dat.Contains(d.CredentialInfo.UserScreenName)); }
public static bool IsFavoredThisWithCurrent(TwitterStatus status) { if (status == null) return false; var ctab = CommonEventServer.CurrentTabData; if (ctab == null) return false; var dat = TweetModel.GetExtraData(status); return ctab.LinkAccounts.Any((a) => dat.IsFavored(a)); }
public static bool IsRetweetedThisWithCurrent(TwitterStatus status) { if (status == null) return false; var ctab = CommonEventServer.CurrentTabData; if (ctab == null) return false; var sd = TweetModel.GetExtraData(status).RetweetTable; if (sd == null) return false; var dat = sd.Select((d) => d.Key.ScreenName).ToArray(); return ctab.LinkAccounts.Any((a) => dat.Contains(a)); }
/// <summary> /// Create twitter status from search api node /// </summary> public static TwitterStatus CreateBySearchNode(XElement sNode) { var ts = new TwitterStatus(); ts.Id = sNode.Element("id").ParseLong(); ts.Truncated = false; ts.Text = sNode.Element("text").ParseString(); ts.Source = sNode.Element("source").ParseString(); ts.Favorited = false; ts.CreatedAt = sNode.Element("created_at").ParseDateTime("ddd MMM d HH':'mm':'ss zzz yyyy"); ts.InReplyToStatusId = 0; ts.InReplyToUserId = sNode.Element("to_user_id").ParseLong(); ts.InReplyToScreenName = sNode.Element("to_user").ParseString(); ts.Kind = StatusKind.SearchResult; ts.User = TwitterUser.CreateBySearchNode(sNode); return ts; }
/// <summary> /// ツイートを公式リツイートします。(非同期) /// </summary> /// <param name="accelems">使用するアカウントの列挙</param> /// <param name="status">リツイートするステータス</param> public static void Retweet(IEnumerable<AccountElement> accelems, TwitterStatus status) { Melchior.Retweet(accelems, status); }
private void RetweetSink(IEnumerable<AccountElement> descriptors, TwitterStatus status) { Parallel.ForEach(descriptors, (d) => { if (Executive.ExecApi(() => d.CredentialInfo.Retweet(status.Id)) != null) { var td = d.TwitterUserData; if (td != null) { if (status.RetweetedOriginal != null) { TweetModel.GetExtraData(status.RetweetedOriginal).AddRetweet(td, DateTime.Now); } else { TweetModel.GetExtraData(status).AddRetweet(td, DateTime.Now); } } } else { InformServer.Report("Retweetできませんでした(@" + d.CredentialInfo.UserScreenName + ")", InformServer.NotifyLevel.Error); } }); InformServer.Report("Retweetしました:" + status.ToString(), InformServer.NotifyLevel.Note); }
internal void Retweet(IEnumerable<AccountElement> descriptors, TwitterStatus status) { Task.Factory.StartNew(() => RetweetSink(descriptors, status), TaskCreationOptions.LongRunning); }
public static bool IsFavoredThis(TwitterStatus status) { if (status == null) return false; var dat = TweetModel.GetExtraData(status); return AccountModel.GetAccountElements().Any((d) => dat.IsFavored(d.CredentialInfo.UserScreenName)); }
public static bool IsMyCurrentTweet(TwitterStatus status) { var ctab = CommonEventServer.CurrentTabData; if (ctab == null) return false; return ctab.LinkAccounts.Any((a) => a == status.User.ScreenName); }
public static bool IsMyTweet(TwitterStatus status) { return AccountModel.GetAccountElements() .Any((d) => status.User.ScreenName == d.CredentialInfo.UserScreenName); }
public static bool PublishedByRetweet(TwitterStatus status) { return status != null && status.PublishedByRetweet; }