本文整理汇总了C#中ITweet类的典型用法代码示例。如果您正苦于以下问题:C# ITweet类的具体用法?C# ITweet怎么用?C# ITweet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITweet类属于命名空间,在下文中一共展示了ITweet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Map
public static AnalyzeTweet Map(ITweet tweet, string track)
{
return new AnalyzeTweet
{
Tweet = MapTweet(tweet, track)
};
}
开发者ID:adamralph,项目名称:HashBus,代码行数:7,代码来源:TweetMapper.cs
示例2: MarkTweetAsReadCommand
public MarkTweetAsReadCommand(ITweet tweet, ITweetSink tweetSink)
{
_tweet = tweet;
_tweetSink = tweetSink;
_observer = new PropertyObserver<ITweet>(_tweet).
RegisterHandler(x => x.IsRead,
x => CanExecuteChanged(this, EventArgs.Empty));
}
开发者ID:GraemeF,项目名称:Twiddler,代码行数:8,代码来源:MarkTweetAsReadCommand.cs
示例3: SerializableTweet
public SerializableTweet(ITweet tweet)
{
this.Creator = tweet.Creator.Name;
this.CreatedAt = tweet.CreatedAt;
this.IsRetweet = tweet.IsRetweet;
this.Language = tweet.Language.ToString();
this.Retweeted = tweet.Retweeted;
this.Text = tweet.Text;
}
开发者ID:juvchan,项目名称:AzureDataLake,代码行数:9,代码来源:SerializableTweet.cs
示例4: Add
public void Add(ITweet tweet)
{
lock (_mutex)
using (IDocumentSession session = _documentStore.OpenSession())
{
session.Store(tweet);
session.SaveChanges();
}
}
开发者ID:GraemeF,项目名称:Twiddler,代码行数:9,代码来源:TwitterDocumentStore.cs
示例5: PublishTweet
// Publish Tweet
public string PublishTweet(ITweet tweet)
{
if (tweet == null)
{
throw new ArgumentException("Tweet cannot be null");
}
return PublishTweet(tweet.TweetDTO);
}
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:10,代码来源:TweetJsonController.cs
示例6: Map
public static TweetReceived Map(ITweet tweet, string track, string endpointName, Guid sessionId)
{
return new TweetReceived
{
EndpointName = endpointName,
SessionId = sessionId,
Tweet = Map(tweet, track)
};
}
开发者ID:pgermishuys,项目名称:HashBus,代码行数:9,代码来源:TweetMapper.cs
示例7: SearchRepliesTo
public IEnumerable<ITweet> SearchRepliesTo(ITweet tweet, bool recursiveReplies)
{
if (tweet == null)
{
throw new ArgumentException("Tweet cannot be null");
}
var repliesDTO = _searchQueryExecutor.SearchRepliesTo(tweet.TweetDTO, recursiveReplies);
return _tweetFactory.GenerateTweetsFromDTO(repliesDTO);
}
开发者ID:SowaLabs,项目名称:Tweetinvi-obsolete,代码行数:10,代码来源:SearchController.cs
示例8: TweetRating
public TweetRating(IAuthorizer client, ITweet tweet)
{
_client = client;
_tweet = tweet;
_observer = new PropertyObserver<IAuthorizer>(_client).
RegisterHandler(x => x.AuthenticatedUser,
x => UpdateIsMention());
UpdateIsMention();
}
开发者ID:GraemeF,项目名称:Twiddler,代码行数:10,代码来源:TweetRating.cs
示例9: FormatTweet
static string FormatTweet(ITweet tweet)
{
var builder = new StringBuilder();
builder.AppendLine(string.Format("{0} (@{1}) - {2}",
tweet.CreatedBy.Name,
tweet.CreatedBy.ScreenName,
tweet.CreatedAt.ToLocalTime().ToString("MM/dd/yy h:mm:ss tt")));
builder.AppendLine(tweet.Text);
return builder.ToString();
}
开发者ID:nerdshark,项目名称:TwitterConsole,代码行数:10,代码来源:Program.cs
示例10: PublishTweetInReplyTo
// Publish Tweet InReplyTo
public bool PublishTweetInReplyTo(ITweet tweetToPublish, ITweet tweetToReplyTo)
{
if (tweetToPublish == null || tweetToReplyTo == null)
{
throw new ArgumentException("Tweet cannot be null!");
}
var publishedTweetDTO = PublishTweetDTOInReplyTo(tweetToPublish.TweetDTO, tweetToReplyTo.TweetDTO);
UpdateTweetIfTweetSuccessfullyBeenPublished(tweetToPublish, publishedTweetDTO);
return tweetToPublish.IsTweetPublished;
}
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:13,代码来源:TweetController.cs
示例11: FollowUserIfRequired
public void FollowUserIfRequired(ITweet tweet)
{
if (FollowWords.Any(word => tweet.Text.IndexOf(word, StringComparison.OrdinalIgnoreCase) > -1))
{
try
{
User.GetLoggedUser().FollowUser(tweet.CreatedBy.Id);
}
catch (Exception)
{
// Ignore exceptions.
}
}
}
开发者ID:jeroenpot,项目名称:JeroenOnAzure,代码行数:14,代码来源:TwitterRepository.cs
示例12: InviTweetToPTTweet
private static FSTweet InviTweetToPTTweet(ITweet t)
{
FSTweet ptTweet = new FSTweet();
if (t.Coordinates != null)
{
ptTweet.Coordinates = t.Coordinates.Longitude.ToString() + ","
+ t.Coordinates.Latitude.ToString();
}
ptTweet.CreatedOn = t.CreatedAt;
ptTweet.Id = t.Id.ToString();
ptTweet.ReplyToId = t.InReplyToUserIdStr;
ptTweet.Text = t.Text;
return ptTweet;
}
开发者ID:anytimecnc,项目名称:ProjectTeddy,代码行数:14,代码来源:HadoopSeeder.cs
示例13: PublishTweet
public bool PublishTweet(ITweet tweet, IPublishTweetOptionalParameters optionalParameters = null)
{
if (tweet == null)
{
throw new ArgumentException("Tweet cannot be null!");
}
var parameters = new PublishTweetParameters(tweet.Text, optionalParameters);
var tweetDTO = InternalPublishTweet(parameters);
UpdateTweetIfTweetSuccessfullyBeenPublished(tweet, tweetDTO);
return tweet.IsTweetPublished;
}
开发者ID:rudiv,项目名称:tweetinvi,代码行数:14,代码来源:TweetController.cs
示例14: InsereRC
private void InsereRC(ref Nodo N, ITweet value)
{
if (N == null)
{
Nodo novoNodo = new Nodo(value);
N = novoNodo;
}
else if (value.CreatedAt < N.valor.CreatedAt) // menor vai pra esquerda
InsereRC(ref N.esquerda, value);
else //if (value >= N.valor) // maior ou igual vai pra direita
InsereRC(ref N.direita, value);
return;
}
开发者ID:KyoZeus,项目名称:BuscaLogo,代码行数:14,代码来源:ArvoreBinaria.cs
示例15: GetTweetMatchingSearchIDs
// find IDs of the search queries that correspond to the streamed tweet
private List<string> GetTweetMatchingSearchIDs(ITweet tweet, string streamQueryID, List<ArrayList<ArrayList<QueryToken>>> searchTokens, List<string> searchQueryIDs)
{
List<int> matchingIdx = CompareStreamToSearchIDs(streamQueryID, searchQueryIDs);
List<ArrayList<ArrayList<QueryToken>>> matchingSearchTokens = searchTokens.Where((x, idx) => matchingIdx.Contains(idx)).ToList();
List<int> matchingIDsIndeces = new List<int>();
foreach (var queryTokens in matchingSearchTokens.Select((value, idx) => new {idx, value}))
if (IsMatch(tweet, queryTokens.value))
matchingIDsIndeces.Add(queryTokens.idx);
matchingIdx = matchingIdx.Where((x, idx) => matchingIDsIndeces.Contains(idx)).ToList();
List<string> matchingIDs = searchQueryIDs.Where((x, idx) => matchingIdx.Contains(idx)).ToList();
return matchingIDs;
}
开发者ID:SowaLabs,项目名称:TwitterStreamingDacq,代码行数:16,代码来源:StreamToSearchAssigner.cs
示例16: Add
public void Add(ITweet tweet)
{
if (tweet.Media != null)
{
foreach (var media in tweet.Media)
{
this.SaveTweetPic(tweet, media.MediaURL, CreateFileName(tweet));
}
}
else
{
// saves the tweet without a picture
this.SaveTweet(tweet);
}
}
开发者ID:bennygrub,项目名称:msl,代码行数:15,代码来源:TweetPicRepository.cs
示例17: HandleTweet
void HandleTweet(ITweet tweet)
{
if ((from tag in tweet.Hashtags where tag.Text == HashtagTrigger select tag).Any())
{
Log.Info("Index rebuild triggered from Twitter by '{0}'".FormatWith(tweet.Creator.Name), this);
CrawlingLog.Log.Info("Index rebuild triggered from Twitter by '{0}'".FormatWith(tweet.Creator.Name));
if (IndexCustodian.IsIndexingPaused(m_index) || IndexCustodian.IsRebuilding(m_index))
{
CrawlingLog.Log.Warn("Indexing call muted");
Log.Info("Indexing call muted", this);
return;
}
IndexCustodian.FullRebuild(m_index);
}
}
开发者ID:varunvns,项目名称:SearchHangout,代码行数:17,代码来源:TwitterUpdateStrategy.cs
示例18: TweetItem
public TweetItem(ITweet tweet)
{
Text = tweet.Text;
CreationDate = tweet.CreatedAt;
User = tweet.Creator.ScreenName;
if (tweet.Creator != null)
{
Language = tweet.Creator.Lang;
if (tweet.Creator.FollowersCount.HasValue)
{
Followers = tweet.Creator.FollowersCount.Value;
}
if (tweet.Creator.FriendsCount.HasValue)
{
Friends = tweet.Creator.FriendsCount.Value;
}
}
}
开发者ID:peac3maker,项目名称:TopicDiscovery,代码行数:19,代码来源:TweetItem.cs
示例19: TweetSentimentData
public TweetSentimentData(ITweet tweet)
{
this.Id = tweet.IdStr;
this.Text = tweet.Text;
if (tweet.InReplyToStatusIdStr != null)
{
this.ReplyToId = tweet.InReplyToStatusIdStr;
}
else
{
this.ReplyToId = "";
}
this.CreatedOn = tweet.CreatedAt;
if (tweet.Coordinates != null)
{
this.Coordinates = tweet.Coordinates.Longitude.ToString() + ","
+ tweet.Coordinates.Latitude.ToString();
}
this.Sentiment = SentimentEngine.CalculateSentiment(this.Text);
}
开发者ID:anytimecnc,项目名称:ProjectTeddy,代码行数:20,代码来源:TweetSentimentData.cs
示例20: MapTweet
private static Tweet MapTweet(ITweet tweet, string track)
{
return tweet == null
? null
: new Tweet
{
CreatedAt = tweet.CreatedAt,
CreatedById = tweet.CreatedBy.Id,
CreatedByIdStr = tweet.CreatedBy.IdStr,
CreatedByName = tweet.CreatedBy.Name,
CreatedByScreenName = tweet.CreatedBy.ScreenName,
Hashtags = tweet.Hashtags
.Select(hashtag =>
new Hashtag
{
Text = hashtag.Text,
Indices = hashtag.Indices,
})
.ToList(),
Id = tweet.Id,
RetweetedTweet = MapTweet(tweet.RetweetedTweet, track),
Text = tweet.Text,
Track = track,
UserMentions = tweet.UserMentions
.Where(userMention => userMention.Id.HasValue)
.Select(userMention =>
new UserMention
{
Id = userMention.Id.Value,
IdStr = userMention.IdStr,
Indices = userMention.Indices,
Name = userMention.Name,
ScreenName = userMention.ScreenName,
})
.ToList(),
};
}
开发者ID:adamralph,项目名称:HashBus,代码行数:37,代码来源:TweetMapper.cs
注:本文中的ITweet类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论