{"id":811,"date":"2012-11-25T17:22:46","date_gmt":"2012-11-25T21:22:46","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/jreyes\/?p=811"},"modified":"2012-11-25T17:27:24","modified_gmt":"2012-11-25T21:27:24","slug":"a-little-birdie-told-congress","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/jreyes\/2012\/11\/25\/a-little-birdie-told-congress\/","title":{"rendered":"A little birdie told Congress"},"content":{"rendered":"<p>Since I couldn&#8217;t find a list of twitter feeds from the US Congress, I made one today.<\/p>\n<p>Now you can get a snap-shot of our legislators highest priorities, as captured in 140 characters at a time, at <a href=\"https:\/\/twitter.com\/CongressBirdie\/legislators\">twitter.com\/CongressBirdie\/legislators<\/a>.<\/p>\n<p>In case you&#8217;re curious how I did it without painstakingly searching each congressperson&#8217;s name and username to add to my list by hand, I&#8217;ll let you in on my little my secret: I relied heavily on a few open source projects to automate the process. To find the Twitter IDs, I simply looked them up from the very excellent Github project <a href=\"https:\/\/github.com\/unitedstates\/congress-legislators\">unitedstates\/congress-legislators<\/a>. Then I used the <a href=\"http:\/\/pypi.python.org\/pypi\/twitter\/\">Python Twitter Tools<\/a> module to chat with the <a href=\"https:\/\/dev.twitter.com\/docs\/api\/1.1\">Twitter API<\/a> to create the list and add all the legislators in bulk.<\/p>\n<p>Life wasn&#8217;t exactly as easy as all that, though. I had to make a little tweaks in order to gather all the tweets. First, there is an easy-to-fix bug in the Python Twitter Tools package. You need to make sure it knows how to POST to <a href=\"https:\/\/dev.twitter.com\/docs\/api\/1.1\/post\/lists\/members\/create_all\">lists\/members\/create_all<\/a> command. Right now employs a GET request&mdash;and that doesn&#8217;t work. It looks like at least one other person has run into the same problem. If you run into the problem, you can <a href=\"http:\/\/stackoverflow.com\/questions\/13163895\/python-twitter-tools-adding-multiple-users-to-a-list-fails-lists-members-crea\">read how I fixed it<\/a>.<\/p>\n<p>But Twitter didn&#8217;t handle my create_all request as they promised. The documentation claims you can add up to 100 users to your list at a time, but that wasn&#8217;t my experience. Instead, I could only get the API to add legislators 25 at a time. But that&#8217;s a small price to pay for democracy.<\/p>\n<p>And this list is active! In the time it took me to write this post, the list reported 13 new tweets. Your tax dollars hard at work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I couldn&#8217;t find a list of twitter feeds from the US Congress, I made one today. Now you can get a snap-shot of our legislators highest priorities, as captured in 140 characters at a time, at twitter.com\/CongressBirdie\/legislators. In case &hellip; <a href=\"https:\/\/archive.blogs.harvard.edu\/jreyes\/2012\/11\/25\/a-little-birdie-told-congress\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":102,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[380,96,142],"tags":[],"class_list":["post-811","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-politics","category-technology"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/posts\/811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/users\/102"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/comments?post=811"}],"version-history":[{"count":4,"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/posts\/811\/revisions"}],"predecessor-version":[{"id":814,"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/posts\/811\/revisions\/814"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/media?parent=811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/categories?post=811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/jreyes\/wp-json\/wp\/v2\/tags?post=811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}