Created
July 2, 2012 02:05
-
-
Save mabster/3030502 to your computer and use it in GitHub Desktop.
SpamProbability Calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if this is not a mention or I follow you, this won't be spam | |
if (IsMention && !_host.Friends.Any(u => u.ScreenName == User.ScreenName)) | |
{ | |
SpamProbability += 0.1; | |
// if they haven't tweeted much, good chance | |
if (item.User.StatusCount < 100) SpamProbability += 0.2; | |
// if they're a recent user, also a sign | |
if (item.User.CreatedAt > DateTime.Today.Subtract(TimeSpan.FromDays(7))) SpamProbability += 0.2; | |
// if the tweet contains a link | |
if (item.Entities.Urls.Any()) SpamProbability += 0.2; | |
// if it mentions other people | |
SpamProbability += 0.1 * (item.Entities.Mentions.Count() - 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment