Use these handy functions to find congessional targets by zip code. AND optionally filter those members by setting:
- A target chamber - e.g.
HouseorSenate - A target party - e.g.
DorR - A list of target senators - either an array of names
["Ted Cruz","Mitch McConnell"], twitter handles["SenTedCruz","McConnellPress"], or Bioguide IDs["B001282","C001098"]
Will return an empty Sunglight API Call { results: [ ], count: 0 } if there are no results after the filter.
Here are some examples:
-
Target the entire Congressional Delegation in the 94103 zip code
TweetCongress('94103',api,function(result) { ... }) -
Target all Republican Legislators in the 97227 zip code
TweetCongress('97227',api,'R',function(result) { ... }) -
Target all House members in the 60616 zip code
TweetCongress('60616',api,'House',function(result) { ... }) -
Target only Ted Cruz in the 73301 zip code - cause seriusly fuck that guy
TweetCongress('73301',api,['Ted Cruz'],function(result) { ... })
Things I'd like to add:
- Allow an 'exact' flag to be passed to the function - this will trigger some sort of dialog that gets lat/lng and allows better drilling down to an exact Congressional District for Zip Codes with multiple reps
- Allow a 'fallback' list to be passed - will tweet at these folks if there aren't any results
- Allow an 'exclude' list - WON'T tweet at these people.
- Should integrate with committees api to allow taretting by committee
- Could also allow for targetting based on bill votes using votes api