Commits

James Michael DuPont committed 07cb91d

got the data, so long and thanks for all the fish

Comments (0)

Files changed (4)

+test :
+	python2.7 ../google_appengine/dev_appserver.py -p 9091  app/
+#see http://localhost:9091/
+
+deploy :
+	python2.7 ../google_appengine/appcfg.py update --oauth2   app/
+
+deploy2 :
+	python2.7 ../google_appengine/appcfg.py update -A tacp-27-test --oauth2   app/
+
 * http://stackoverflow.com/questions/5697844/how-to-set-filename-property-in-blobstore
 
 when we do all the files at ones FileNotOpenedError :
-so we Create 50 Files.
+so we Create 50 Files on the server, 
 * http://code.google.com/p/googleappengine/issues/detail?id=5731
 http://stackoverflow.com/questions/8201283/google-app-engine-how-to-write-large-files-to-google-cloud-storage
 * http://stackoverflow.com/questions/11514264/filenotopenederror-with-cloud-storage-on-gae
 * http://stackoverflow.com/questions/9266187/error-filenotopenederror
 
+
+I then use this command to download all the data :
+  wget -r -d 1 "http://3.theanticorruptionpledge.appspot.com/export/list"
+  tar -czf data.tgz 3.theanticorruptionpledge.appspot.com/
+

app/templatefilters/__init__.py

+VERSION = (0, 1, 1)
+__version__ = '.'.join(map(str, VERSION))
+__author__ = "James Michael DuPont"
+__author_email__ = 'jamesmikedupont@gmail.com'
+__url__ = "bitbucket.org/h4ck3rm1k3/the-anti-corruption-pledge/"

scripts/getgoogle2.pl

+use HTTP::Cookies;
+use LWP::UserAgent;
+use HTTP::Request::Common qw(POST);
+
+
+my $app="http://3.theanticorruptionpledge.appspot.com/";
+
+my $ua = LWP::UserAgent->new(  );
+
+
+my %STATES2 = (
+    'AL'=>'Alabama', 
+    'AK'=>'Alaska', 
+    'AS'=>'American Samoa', 
+);
+
+#
+my %STATES = (
+    'AL'=>'Alabama', 
+    'AK'=>'Alaska', 
+    'AS'=>'American Samoa', 
+    'AZ'=>'Arizona', 'AR'=>'Arkansas', 'CA'=>'California', 'CO'=>'Colorado', 'CT'=>'Connecticut', 'DC'=>'District of Columbia', 'DE'=>'Delaware', 'FL'=>'Florida', 'GA'=>'Georgia', 'GU'=>'Guam', 'HI'=>'Hawaii', 'ID'=>'Idaho', 'IL'=>'Illinois', 
+    'IN'=>'Indiana', 
+    'IA'=>'Iowa', 'KS'=>'Kansas', 'KY'=>'Kentucky', 'LA'=>'Louisiana', 'ME'=>'Maine', 
+    'MD'=>'Maryland', 'MA'=>'Massachusetts', 'MI'=>'Michigan', 'MN'=>'Minnesota', 'MS'=>'Mississippi', 
+    'MO'=>'Missouri', 'MP'=>'Northern Mariana Islands', 'MT'=>'Montana', 'NE'=>'Nebraska', 'NV'=>'Nevada', 
+    'NH'=>'New Hampshire', 'NJ'=>'New Jersey', 'NM'=>'New Mexico', 'NY'=>'New York', 'NC'=>'North Carolina', 
+    'ND'=>'North Dakota', 'OH'=>'Ohio', 'OK'=>'Oklahoma', 'OR'=>'Oregon', 'PA'=>'Pennsylvania', 'PR'=>'Puerto Rico', 'RI'=>'Rhode Island', 'SC'=>'South Carolina', 'SD'=>'South Dakota', 'TN'=>'Tennessee', 'TX'=>'Texas', 'UT'=>'Utah', 'VT'=>'Vermont', 'VA'=>'Virginia', 'VI'=>'Virgin Islands',
+    'WA'=>'Washington', 'WV'=>'West Virginia', 'WI'=>'Wisconsin', 'WY'=>'Wyoming', 'DC'=>'Washington, D.C.'
+);
+
+foreach my $state  (keys %STATES) { 
+#   warn $state;
+#    next;
+    $response = $ua->get(
+        $app . 
+        '/export/pledge/' . $state . '/csv/'
+        );
+    die "\nError: ", $response->status_line unless $response->is_success;
+    
+    print $response->as_string;
+}
+