Permalink
Browse files

Turn all twitter handles to lowercase when comparing

You can't have different users with twitter handles only differing in
case anyway.
  • Loading branch information...
1 parent bdc9e98 commit ab3ac58a26bc853648b46b5aa4aa872896338e28 @mhagander committed Sep 11, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 synctwitter.py
  2. +1 −1 twitterclient.py
View
@@ -23,7 +23,7 @@ def __init__(self, cfg):
def Run(self):
# Get list of handles that should be on the list
curs = self.db.cursor()
- curs.execute("SELECT DISTINCT twitteruser FROM planet.feeds WHERE NOT (twitteruser IS NULL OR twitteruser='') ORDER BY twitteruser");
+ curs.execute("SELECT DISTINCT lower(twitteruser) FROM planet.feeds WHERE NOT (twitteruser IS NULL OR twitteruser='') ORDER BY twitteruser");
expected = set([r[0].replace('@','') for r in curs.fetchall()])
# Get list of current screen names the list is following
View
@@ -66,7 +66,7 @@ def list_subscribers(self):
response = self.twitter_request('%s/%s/members.json' % (self.twittername, self.twitterlist), 'GET', {
'cursor': cursor,
})
- handles.extend([x['screen_name'] for x in response['users']])
+ handles.extend([x['screen_name'].lower() for x in response['users']])
cursor = response['next_cursor']
return handles

0 comments on commit ab3ac58

Please sign in to comment.