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
| #!/usr/bin/env ruby | |
| # Just a simple demo on how to use SODA 2.0 to access data from a Socrata data site | |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| require 'cgi' | |
| require 'pp' | |
| # Just a helper class |
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
| package gov.hawaii.data.demo; | |
| import java.util.ArrayList; | |
| import java.util.Date; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.Map; | |
| import com.socrata.api.Connection; | |
| import com.socrata.api.HttpConnection; |
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
| [ { | |
| "content" : { | |
| "id" : "apps-plate", | |
| "contextId" : "foods", | |
| "children" : [ { | |
| "text" : "Choose a Food", | |
| "type" : "Title" | |
| }, { | |
| "type" : "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
| // Location value is special | |
| double latitude = (rand.nextInt(180000)/1000.0) - 90.0; | |
| double longitude = (rand.nextInt(360000)/1000.0) - 180.0; | |
| Map<String, Double> location = new HashMap<String,Double>(); | |
| location.put("latitude", latitude); | |
| location.put("longitude", longitude); | |
| r.putDataField(v.getColumnByApiIdentifier("location"), location); |
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
| function! HtmlEntities() | |
| silent %s/À/\À/eg | |
| silent %s/Á/\Á/eg | |
| silent %s/Â/\Â/eg | |
| silent %s/Ã/\Ã/eg | |
| silent %s/Ä/\Ä/eg | |
| silent %s/Å/\Å/eg | |
| silent %s/Æ/\Æ/eg | |
| silent %s/Ç/\Ç/eg | |
| silent %s/È/\È/eg |
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
| * About to connect() to nycopendata.socrata.com port 80 (#0) | |
| * Trying 216.227.229.140... % Total % Received % Xferd Average Speed Time Time Time Current | |
| Dload Upload Total Spent Left Speed | |
| 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0connected | |
| * Connected to nycopendata.socrata.com (216.227.229.140) port 80 (#0) | |
| > GET /download/fum3-ejky/application%252Fzip HTTP/1.1 | |
| > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 | |
| > Host: nycopendata.socrata.com | |
| > Accept: */* | |
| > |
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
| <html><body>You are being <a href="http://nycopendata.socrata.com/api/file_data/RmDbuOaF2Ix4qRBCywjyAQoeRy55Hz8L2kQHZy8R3Mc?filename=DCP_POPS.zip.uoaf2ix4qrbcywjyaqoery55hz8l2kqhzy8r3mc">redirected</a>.</body></html> |
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
| { | |
| "skip" : 0, | |
| "idColumnIndex" : 0, | |
| "appendOnly" : true, | |
| "publishOnComplete" : false, | |
| "fixedWidthFields" : { | |
| "System" : "4", | |
| "Doc Ref ID" : "20", | |
| "Doc Version" : "20", | |
| "Check Amount" : "22", |
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
| package com.socrata.demo; | |
| import java.io.IOException; | |
| import java.io.StringReader; | |
| import com.socrata.api.Connection; | |
| import com.socrata.api.HttpConnection; | |
| import com.socrata.api.RequestException; | |
| import com.socrata.data.View; | |
| import com.socrata.data.View.Row; |
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
| package com.saxon.demo; | |
| import java.io.File; | |
| import com.socrata.api.Connection; | |
| import com.socrata.api.HttpConnection; | |
| import com.socrata.api.RequestException; | |
| import com.socrata.data.View; | |
| public class Creator { |