Skip to content

Instantly share code, notes, and snippets.

@mabster
Created July 2, 2012 02:05
Show Gist options
  • Save mabster/3030502 to your computer and use it in GitHub Desktop.
Save mabster/3030502 to your computer and use it in GitHub Desktop.
SpamProbability Calculation
// 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