This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- SOCIAL SHARING SNIPPET | |
| make sure you include the socialsnippet.js, get-involved.css, and socialsnippet.css | |
| --> | |
| <script type="text/javascript" src="http://propublica.s3.amazonaws.com/assets/social/socialsnippet.js"></script> | |
| <link rel="stylesheet" href="http://propublica.s3.amazonaws.com/assets/social/socialsnippet.css"> | |
| <div class="social_section"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| propublica.views.nameTypeaheadWidget = propublica.View.extend({ | |
| tag : "input", | |
| cssClass : "name_typeaheadwidget", | |
| bindings : { | |
| "selected" : "matchNameWidget" | |
| }, | |
| render : function() { | |
| var congress_names = ["Aaron Schock","Adam B. Schiff","William Cowan","Adam Kinzinger","Adam Smith","Adrian Smith","Al Franken","Al Green","Alan Grayson","Alan Lowenthal","Alan Nunnelee","Albio Sires","Alcee L. Hastings","Allyson Y. Schwartz","Ami Bera","Amy Klobuchar","Ander Crenshaw","Andre Carson","Andy Barr","Andy Harris","Angus King","Ann Kirkpatrick","Ann McLane Kuster","Ann Wagner","Anna G. Eshoo","Austin Scott","Barack Obama","Barbara A. Mikulski","Barbara Boxer","Barbara Lee","Ben Ray Lujan","Benjamin L. Cardin","Bennie Thompson","Bernard Sanders","Beto O'Rourke","Betty McCollum","Bill Cassidy","Bill Flores","Bill Foster","Bill Huizenga","Bill Johnson","Bill Keating","Bill Nelson","Bill Owens","Bill Pascrell","Bill Posey","Bill Shuster","Bill Young","Billy Long","Blaine Luetkemeyer","Blake Farent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| propublica.views.nameTypeahead = propublica.View.extend({ | |
| tag : "input", | |
| cssClass : "name_typeahead", | |
| bindings : { | |
| "selected" : "matchNameMain" | |
| }, | |
| render : function() { | |
| var congress_names = ["Aaron Schock","Adam B. Schiff","Adam Kinzinger","Adam Smith","Adrian Smith","Al Franken","Al Green","Alan Grayson","Alan Lowenthal","Alan Nunnelee","Albio Sires","Alcee L. Hastings","Allyson Y. Schwartz","Ami Bera","Amy Klobuchar","Ander Crenshaw","Andre Carson","Andy Barr","Andy Harris","Angus King","Ann Kirkpatrick","Ann McLane Kuster","Ann Wagner","Anna G. Eshoo","Austin Scott","Barack Obama","Barbara A. Mikulski","Barbara Boxer","Barbara Lee","Ben Ray Lujan","Benjamin L. Cardin","Bennie Thompson","Bernard Sanders","Beto O'Rourke","Betty McCollum","Bill Cassidy","Bill Flores","Bill Foster","Bill Huizenga","Bill Johnson","Bill Keating","Bill Nelson","Bill Owens","Bill Pascrell","Bill Posey","Bill Shuster","Bill Young","Billy Long","Blaine Luetkemeyer","Blake Farenthold","Bob Casey","Bob Corker" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # task :bundlegeocode => :environment do | |
| # require 'goog_geocoder' | |
| # factory = ::RGeo::Geographic.simple_mercator_factory() | |
| # f = CSV.open("#{Rails.root.to_s}/db/initial/bundlecities.csv", :headers => true) | |
| # f.each do |row| | |
| # city = row["city"] | |
| # state = row["state"] | |
| # goog = GoogGeocoder.new("#{city},#{state}") | |
| # if !goog.resp["results"].empty? | |
| # accuracy = goog.resp["results"].first["geometry"]["location_type"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| REGIONS = {"NORTHEAST" => ["CONNECTICUT"," MAINE"," MASSACHUSETTS"," NEW HAMPSHIRE"," RHODE ISLAND"," VERMONT"," NEW JERSEY"," NEW YORK"," PENNSYLVANIA"], | |
| "MIDWEST" => ["ILLINOIS"," INDIANA"," MICHIGAN"," OHIO"," WISCONSIN"," IOWA"," KANSAS"," MINNESOTA"," MISSOURI"," NEBRASKA"," NORTH DAKOTA"," SOUTH DAKOTA"], | |
| "SOUTH" => ["DELAWARE"," FLORIDA"," GEORGIA"," MARYLAND"," NORTH CAROLINA"," SOUTH CAROLINA"," VIRGINIA"," WASHINGTON D.C."," WEST VIRGINIA"," ALABAMA"," KENTUCKY"," MISSISSIPPI"," TENNESSEE"," ARKANSAS"," LOUISIANA"," OKLAHOMA"," TEXAS"], | |
| "WEST" => ["ARIZONA"," COLORADO"," IDAHO"," MONTANA"," NEVADA"," NEW MEXICO"," UTAH"," WYOMING"," ALASKA"," CALIFORNIA"," HAWAII"," OREGON"," WASHINGTON"]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //////// THE MODEL, making GunsMap and defining the function getColors();//////// | |
| propublica.models.GunsMap = propublica.Model.extend({ | |
| getColors : function() { | |
| var arr = ["H001064","D000191","L000573","A000369","K000382","M000133","L000559","S000522","C000714","Y000033","H001050"] | |
| $(".carto .tiny_size .color_overlay").each(function() { | |
| var bioid = $(this).parents(".member_box").attr("data-id"); | |
| if (arr.indexOf(bioid) > -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| propublica.views.FrackMap = propublica.View.extend({ | |
| id : "frack", | |
| render : function() { | |
| var frackdata = { | |
| "LA":[14986, 37499, 400594, 1242678, 2088306, 2130551, "Louisiana"], | |
| "NM":[54020, 57462, 60590, 71867, 93071, 127548 , "New Mexico"], | |
| "OK":[83015, 204474, 327805, 406143, 449167, 503329, "Oklahoma"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var tooltip = $("#tooltip"); | |
| tooltip.hide() | |
| var bar = $(".bar"); | |
| bar.hover(function(e) { | |
| tooltip.show() | |
| $(this).addClass("active"); | |
| var text = $(this).html(); | |
| tooltip.html(text); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'restclient' | |
| require 'nokogiri' | |
| require 'logger' | |
| require 'net/http' | |
| require 'mechanize' | |
| # page_num = 2 | |
| # item_num = 2 | |
| SEARCH_URL = "http://cgmix.uscg.mil/IIR/IIRSearch.aspx" |