Module Expr Str ImportFrom alias Import alias Import alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults Num body For NameStore Call NameLoad Num Call NameLoad NameLoad NameLoad body Expr Yield SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore Str FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str attr Str Assign NameStore Call NameLoad Call NameLoad NameLoad TupleLoad Assign NameStore Call NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Str For NameStore NameLoad body Assign NameStore BinOpMod Str Call AttributeLoad Str attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body TryExcept body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore BoolOpOr SubscriptLoad NameLoad Index Str Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr BinOpMod Str SubscriptLoad NameLoad Index Str Pass Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str Call AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A 
Uses the Twitter API bulk lookup to grab data for 100 users at at time.

Filters our Person records for those with Twitter usernames, breaks
that list into chunks of 100, then hits the Twitter lookup with each
chunk. Loops through the response and uses an .update() query to update
the `twitter_bio` and `twitter_profile_image_url` for each Person.
 datetime datetime N/A json N/A logging N/A oauth2 oauth time sleep django.conf settings django.core.management.base BaseCommand source.people.models Person N/A SLEEP_SECONDS 6 N/A CONSUMER_KEY N/A settings TWITTER_CONSUMER_KEY N/A CONSUMER_SECRET N/A settings TWITTER_CONSUMER_SECRET N/A ACCESS_KEY N/A settings TWITTER_ACCESS_TOKEN N/A ACCESS_SECRET N/A settings TWITTER_ACCESS_TOKEN_SECRET N/A N/A N/A logging basicConfig filename twitter_update.log filemode w level N/A logging INFO chunks N/A N/A object_list chunk_size N/A 100 N/A N/A i N/A xrange 0 N/A len object_list chunk_size N/A N/A N/A N/A object_list N/A i N/A i chunk_size N/A Command N/A BaseCommand N/A N/A help Uses Twitter 1.1 API to update bios and profile images for Person records. handle N/A N/A self N/A args options N/A N/A N/A N/A logging info N/A Started update: %s N/A N/A datetime now N/A person_queryset N/A N/A N/A N/A N/A Person objects exclude twitter_username values_list twitter_username N/A person_list N/A list N/A sum person_queryset N/A N/A person_list_sets N/A list N/A chunks person_list N/A consumer N/A N/A oauth Consumer key CONSUMER_KEY secret CONSUMER_SECRET N/A access_token N/A N/A oauth Token key ACCESS_KEY secret ACCESS_SECRET N/A client N/A N/A oauth Client consumer access_token N/A api_endpoint https://api.twitter.com/1.1/users/lookup.json N/A person_set person_list_sets N/A N/A querystring N/A ?screen_name=%s N/A N/A , join person_set N/A N/A response data N/A N/A client request N/A %s%s N/A api_endpoint querystring N/A users N/A N/A json loads data N/A user users N/A N/A N/A N/A twitter_username N/A user N/A screen_name N/A twitter_avatar N/A user N/A profile_image_url_https N/A twitter_bio N/A N/A user N/A description N/A N/A N/A N/A N/A N/A Person objects filter twitter_username__iexact twitter_username update twitter_bio twitter_bio twitter_profile_image_url twitter_avatar N/A N/A N/A logging info N/A Succesful update: %s twitter_username N/A N/A N/A N/A N/A N/A logging info N/A ERROR: %s N/A user N/A screen_name N/A N/A N/A sleep SLEEP_SECONDS N/A N/A N/A logging info N/A Finished update: %s N/A N/A datetime now N/A N/A