Pretty print those complex services json replies..

not rocket-science, but something handy for debugging/developing web apps, use this to pretty print and validate the JSON responses

$ echo '{"json":"obj"}' | python -m simplejson.tool
{
    "json": "obj"
}

or

$ lynx -source "http://ws.geonames.org/weatherJSON?north=44.1&south=-9.9&east=-22.4&west=55.2"|python -m simplejson.tool

{                                                                                                                                                                                  
    "weatherObservations": [                                                                                                                                                       
        {                                                                                                                                                                          
            "ICAO": "LTAE",                                                                                                                                                        
            "clouds": "n/a",                                                                                                                                                       
            "datetime": "2010-05-24 01:50:00",                                                                                                                                     
            "dewPoint": "5",                                                                                                                                                       
            "hectoPascAltimeter": 1015,                                                                                                                                            
            "humidity": 100,                                                                                                                                                       
            "lat": 40.0666666666667,                                                                                                                                               
            "lng": 32.5666666666667,                                                                                                                                               
            "observation": "LTAE 240150Z 03003KT CAVOK 05/05 Q1015 NOSIG RMK RWY21 04003KT",                                                                                       
            "stationName": "Murted Tur-Afb ",                                                                                                                                      
            "temperature": "5",                                                                                                                                                    
            "weatherCondition": "n/a",                                                                                                                                             
            "windDirection": 30,                                                                                                                                                   
            "windSpeed": "03"                                                                                                                                                      
        },                                   
...

0
Your rating: None