{"api_host" : "The hostname of your API server. You may also specify the port.","api_host" : "hodorhodor.com",
"retry_interval" : "The interval in seconds between retrying failed API calls","retry_interval" : 10,
"auth_token" : "The authentication token. It is available in your developer dashboard under 'Settings'","auth_token" : "5ad0eb93697215bc0d48a7b69aa6fb8b",
"favorite_numbers": "An array containing my all-time favorite numbers","favorite_numbers": [19, 13, 53]}
?(/* AAPL historical OHLC data from the Google Finance API */[/* May 2006 */[1147651200000,67.79],[1147737600000,64.98],...[1368057600000,456.77],[1368144000000,452.97]]);
{"note1" : "This demonstrates the provision of annotations within a JSON file","field1" : 12,"field2" : "some text",
"note2" : "Add more annotations as necessary"}
{"//": "Some browsers will use this to enable push notifications.","//": "It is the same for all projects, this is not your project's sender ID","gcm_sender_id": "1234567890"}
{"Notations": [{"anchorX": 333,"anchorY": 265,"areaMode": "Ellipse","extentX": 356,"extentY": 294,"opacity": 0.5,"text": "Elliptical area on top","textX": 333,"textY": 265,"title": "Notation 1"},{"anchorX": 87,"anchorY": 385,"areaMode": "Rectangle","extentX": 109,"extentY": 412,"opacity": 0.5,"text": "Rect area\non bottom","textX": 98,"textY": 385,"title": "Notation 2"},{"anchorX": 69,"anchorY": 104,"areaMode": "Polygon","extentX": 102,"extentY": 136,"opacity": 0.5,"pointList": [{"i": 0,"x": 83,"y": 104},{"i": 1,"x": 69,"y": 136},{"i": 2,"x": 102,"y": 132},{"i": 3,"x": 83,"y": 104}],"text": "Simple polygon","textX": 85,"textY": 104,"title": "Notation 3"}],"imageXW": 512,"imageYW": 512,"imageName": "lena_std.ato","tinyDocs": {"c01": "JSON image notation data:","c02": "-------------------------","c03": "","c04": "This data contains image notations and related area","c05": "selection information that provides a means for an","c06": "image gallery to display notations with elliptical,","c07": "rectangular, polygonal or freehand area indications","c08": "over an image displayed to a gallery visitor.","c09": "","c10": "X and Y positions are all in image space. The image","c11": "resolution is given as imageXW and imageYW, which","c12": "you use to scale the notation areas to their proper","c13": "locations and sizes for your display of the image,","c14": "regardless of scale.","c15": "","c16": "For Ellipses, anchor is the center of the ellipse,","c17": "and the extents are the X and Y radii respectively.","c18": "","c19": "For Rectangles, the anchor is the top left and the","c20": "extents are the bottom right.","c21": "","c22": "For Freehand and Polygon area modes, the pointList","c23": "contains a series of numbered XY points. If the area","c24": "is closed, the last point will be the same as the","c25": "first, so all you have to be concerned with is drawing","c26": "lines between the points in the list. Anchor and extent","c27": "are set to the top left and bottom right of the indicated","c28": "region, and can be used as a simplistic rectangular","c29": "detect for the mouse hover position over these types","c30": "of areas.","c31": "","c32": "The textx and texty positions provide basic positioning","c33": "information to help you locate the text information","c34": "in a reasonable location associated with the area","c35": "indication.","c36": "","c37": "Opacity is a value between 0 and 1, where .5 represents","c38": "a 50% opaque backdrop and 1.0 represents a fully opaque","c39": "backdrop. Recommendation is that regions be drawn","c40": "only if the user hovers the pointer over the image,","c41": "and that the text associated with the regions be drawn","c42": "only if the user hovers the pointer over the indicated","c43": "region."}}
fetch(filename).then(function(response) {return response.text();}).then(function(commented) {return commented.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1').replace(/\r/,"\n").replace(/\n[\n]+/,"\n");}).then(function(clean) {return JSON.parse(clean);}).then(function(json) {// Do what you want with the JSON object.});
import json, re
def parse_json(data_string):result = []for line in data_string.split("\n"):line = line.strip()if len(line) < 1 or line[0:2] == "//":continueif line[-1] not in "\,\"\'":line = re.sub("\/\/.*?$", "", line)result.append(line)return json.loads("\n".join(result))
print(parse_json("""{// This is a comment"name": "value" // so is this// "name": "value"// the above line gets removed}"""))
{"": "Location to post to","postUrl": "https://example.com/upload/",
"": "Username for basic auth","username": "joebloggs",
"": "Password for basic auth (note this is in clear, be sure to use HTTPS!","password": "bloejoggs"}
"part_of_speech": {"__comment": ["@param {String} type - the following types can be used: ","NOUN, VERB, ADVERB, ADJECTIVE, PRONOUN, PREPOSITION","CONJUNCTION, INTERJECTION, NUMERAL, PARTICLE, PHRASE","@param {String} type_free_form - is optional, can be empty string","@param {String} description - is optional, can be empty string","@param {String} source - is optional, can be empty string"],"type": "NOUN","type_free_form": "noun","description": "","source": "https://google.com","noun_class": {"__comment": ["@param {String} noun_class - the following types can be used: ","1_class, 2_class, 3_class, 4_class, 5_class, 6_class"],"noun_class": "4_class"}}