Better spam logging.

This commit is contained in:
Samuel Clay 2014-09-17 13:40:57 -07:00
parent a19bc9f786
commit 2c41b3ae70
3 changed files with 13 additions and 9 deletions

View file

@ -9,7 +9,6 @@ import random
import requests
import HTMLParser
from collections import defaultdict
from pprint import pprint
from BeautifulSoup import BeautifulSoup
from mongoengine.queryset import Q
from django.conf import settings
@ -1512,8 +1511,6 @@ class MSharedStory(mongo.Document):
for user_id, feeds in ddusers.items():
users[user_id] = dict(feeds)
pprint(users)
guaranteed_spammers = []
for user_id in ddusers.keys():
u = User.objects.get(pk=user_id)
@ -1522,9 +1519,16 @@ class MSharedStory(mongo.Document):
read_story_count = RUserStory.read_story_count(user_id)
feed_count = UserSubscription.objects.filter(user=u).count()
share_count = MSharedStory.objects.filter(user_id=user_id).count()
print " ---> %s (%s): feed_opens:%s feeds:%s read:%s shared:%s" % (
u.username, u.pk,
feed_opens,
feed_count,
read_story_count,
share_count,
)
if not feed_opens: guaranteed_spammers.append(user_id)
if (feed_count <= 5 and
feed_opens <= 5 and
feed_opens <= 10 and
read_story_count < share_count*2): guaranteed_spammers.append(user_id)
print " ---> Guaranteed spammers: %s" % guaranteed_spammers
@ -1534,7 +1538,7 @@ class MSharedStory(mongo.Document):
user = User.objects.get(pk=spammer_id)
user.profile.delete_user(confirm=True, fast=True)
return users, guaranteed_spammers
return guaranteed_spammers
@classmethod
def get_shared_stories_from_site(cls, feed_id, user_id, story_url, limit=3):

View file

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.1.0</string>
<string>4.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -58,7 +58,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4.1.0</string>
<string>4.2.0</string>
<key>FacebookAppID</key>
<string>230426707030569</string>
<key>LSRequiresIPhoneOS</key>

View file

@ -3551,7 +3551,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -3590,7 +3590,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",