Questions tagged [json]

JSON (JavaScript Object Notation) aka the Fat Free Alternative to XML is a lightweight data exchange format inspired by JavaScript object literals. It is often used with JavaScript, Ajax, and RESTful web services but is completely language independent.

Filter by
Sorted by
Tagged with
2
votes
1answer
1k views

Store nested json repsonses in relational database

The goal is to collect market data from a free rest api. The response is in json and size per response is above 1MB. I want to get at least updated data once per minute which means about 24h * 60min * ...
4
votes
2answers
531 views

Type-safe JSON deserialization

In a Python (3.6) application I receive messages from Kafka in JSON format. (The code base makes heavy use of static type annotations, and every file is automatically checked using ...
4
votes
2answers
171 views

Fetching data through HTTP and caching JSON result in a file

The task is to fetch some JSON data from an API with a GET request. If the location is not available for any reason, read a cache file. Otherwise write the cache file for future use. The following ...
2
votes
3answers
1k views

Converting objects into JSON and using the StringBuilder

In my scenario I have list of object in C# code and need to be converted into JavaScript object. But there are certain condition, where the value of the object might be dynamic based on certain key. ...
2
votes
1answer
445 views

Looping JSON in WebAPI Controller and Add new Property

I have a json array that is being passed into a function. Whenever the function comes across a field (call it Field1) in a record with a value that starts with "@!!!@" the function compile them into ...
3
votes
1answer
85 views

Extracting text from Bundestag proceedings as directed by XML files, and exporting to JSON

I have a long script here that does the following for me: I have 9000 XML files, from which I parse information, and then in about 7000 TXT files find the information out, and in the end it all save ...
17
votes
4answers
4k views

User login database intended for beginners

I have been working on a small project intended for helping beginner Python programmers getting an idea of what a real project could be like (as opposed to programming exercises and such). This ...
6
votes
2answers
345 views

Scan similar files in different directories and report differences

I wrote a program in Python that scans all files in a directory, makes dictionaries with stuff like date of creation and a hash of the contents of a file. Then i scan another directory which is just a ...
1
vote
1answer
3k views

Slow Converting from JsonArray to ArrayList

I have to convert a JsonArray to an ArrayList but unfortunately the code below is used very often during the execution of the program! How can I speed it up? Java: ...
2
votes
1answer
91 views

Convenience function for writing files in CSV, JSON, etc

The McCabe code complexity of the following function is 19 as found by pytest --mccabe test.py (from my toy-project mpu). While ...
1
vote
1answer
75 views

Live search project

I have a live search project and I don't know if it's secure enough or not. I don't access it directly, but I get data by JSON so I shouldn't worry about slashes or quotes, right? The PHP code: <...
3
votes
1answer
188 views

Show 3d models loaded via asynchronous request

First I explain the data to give context: We have the following folder structure: ...
4
votes
1answer
2k views

Trying to map JSON to different classes in web API [closed]

I have a controller action that takes JSON bodies. I know, that the JSON is either of type A or B, where both classes are of ...
3
votes
0answers
3k views

Function to return JSON-like objects using VBA collections and arrays

My goal is to create a compact function that can create a JSON Like object from JSON string. I want a function with a small footprint that I or anyone who wants to use it, can simply paste into a ...
3
votes
1answer
235 views

React pagination without JSX

I've published my first react project for pagination purposes. It's likely I'm making mistakes or there are any improvements to my code. I'd appreciate if anyone has any offers. ...
0
votes
2answers
8k views

Return json to browser via MVC controller for morris chart

Program is written in .Net Framework 4. Class: ...
0
votes
1answer
37 views

Get latest jsons with respect to [version and name] key in subjson in java

This is the json ...
5
votes
2answers
26k views

Convert Json response to object array

I'm looking for the best solution. Here is a response from server and i need to get Organizations list: ...
6
votes
2answers
180 views

Program to calculate some stats from Facebook messages

I've written a program that parses JSON downloaded from Facebook to calculate some stats from a conversation between two parties. It attemps to count these things: Messages grouped by day of week ...
5
votes
2answers
990 views

Apple receipt validator

I'm working on a solution for validating Apple receipts. Here's the repository as whole. I based it mostly on the gdx-pay-server library. In my implementation, one of the classes I want to improve is <...
2
votes
0answers
1k views

Read and write to multiple json files

We have some json template files that get deployed to our prod, QA, integration, dev servers. Various fields need to be changed depending on the server being deployed to. Right now, this is done ...
0
votes
1answer
21 views

Get real time geojson on Javascript

I frequently need to obtain some info about coordinates, because I have dynamic elements on a map (in Openlayers). So I use SetInterval and XMLHttpRequest Object to do it. ...
37
votes
0answers
1k views

JSON formatter in your least favorite language

Just joking guys, Brainfuck is an awesome, challenging language. I've tested the following code with bf-x86 compiler and rather big JSON file. I believe code is fully functional on a valid (!) JSON ...
5
votes
2answers
782 views

Convert JSON from a webservice to text file

I get list JSON text from a webservice and list_of_columns is predefined, I need the output in that format. I am not sure about few things which are as follows I ...
2
votes
4answers
221 views

Set of jQuery .click functions

Restaurant Menu It works how I want it to, but the way I've written the jQuery looks like it could be simplified. How can I rewrite the jQuery so it does exactly the same thing but in much less code? ...
3
votes
1answer
2k views

Fetch, parse, and store JSON in PostgreSQL

I was given a task to read JSON from a URL and then parse it in python. Each field will be assigned to a variable to store the value. The value will then be stored into postgres table. Example of ...
2
votes
0answers
110 views

Determine the country by an IP

EDIT: I have updated the code, if you have comments about the previous version of the code, please do post them anyway. The task is to determine the country by an IP. Provided programme queries two ...
6
votes
2answers
156 views

Web Request Utility

Our company consumes a lot of telemetered data from sensors which we consume via an API. So I wrote a method to consume them a bit easier for internal applications. I didn't add a generic to the ...
1
vote
0answers
853 views

Parsing a JSON array from a JSON object

So its my first time using Kotlin, and for now I am converting old Java code to Kotlin. I took a simple function to parse a JSONArray from a ...
1
vote
0answers
26 views

Suppressing debug for JSON in FW/1

I am trying to suppress debug with doing a JSON request. Is this too early or too late in the request lifecycle? Is there a better variable to tap into? In application.cfc ...
2
votes
1answer
39 views

Generate a Json from Strings using Jackson library

I am pretty new to Java and I got a requirement of converting Strings to a json structure. My below codes works fine but I have to create multiple objects and my code looks bit ugly. I want to know ...
1
vote
2answers
248 views

Calculation with Jquery

...
2
votes
2answers
206 views

Logging the name of recipes using ingredients

Given two objects with some food data, log the name of the recipe and ingredients names separated by conjunction "and". Please run the code I have attached to see the expected output. condition - ...
7
votes
2answers
177 views

Simple console JSON formatter

I am writing simple formatter for valid JSON. Is reads JSON data from stdin and writes formatted output to stdout. Goals: given valid input produce valid formatted JSON output constant memory usage ...
6
votes
1answer
76 views

A simple BSON indenter / compacter

BSON is an extended JSON format. For example these documents are valid BSON documents, but invalid JSON documents: prettified documents: ...
4
votes
1answer
184 views

Local weather app made with Typescript

I would like feedback on my Local weather app. This site simply gets the local weather. I refactored it from jQuery to Typescript to try to learn more about Typescript. Here is a demo: https://...
2
votes
0answers
52 views

Basic to-do CLI app (with JSON for persistence) using Python

I’m very new to Python. I wanted to start out with a simple project: a CLI app that keeps track of my to-do’s. The code works as intended, but is what I have written is any good? File structure: <...
1
vote
1answer
125 views

Getting data from an API in JSON format

I'm getting data from an API in JSON format. It's getting the resting heart rate of the user and inserting it into my database. It gets today's date as well as a couple days in the past and updates ...
1
vote
1answer
1k views

Javascript Stringify Nested Objects with Loop References

I created these functions that will take any object and stringify it, and can then de-stringify it later. ...
6
votes
1answer
2k views

Iterating through nested array of objects

I have the following JSON list of objects, and I'm able to find the required object, and pass it back to the caller, given the id. Everything works fine, I'm just ...
7
votes
2answers
313 views

Parsing and creating JSON packets

For several of my pet projects, I have had to interpret and/or send JSON WebSocket or HTTP responses in Java. I did some research and picked the library GSON to use. In each project, I have ...
3
votes
2answers
1k views

Quiz app from a JSON file

My code fetches quiz data from a JSON file, displays the questions sequentially and records the user's answers. It keeps track of the user's score and at the end display the user's result based on a ...
1
vote
1answer
497 views

Accessing a list of dictionaries in a list of dictionaries [closed]

I have 4-deep JSON data structure. Basically its a list of dictionaries nested in a list of dictionaries. This is my first time working with this kind of nested data. Below I have done my best to ...
3
votes
0answers
271 views

Accessing Apixu weather API

My code is a module to simplify accessing a weather API. I'm quite certain it could be simplified, just not sure how yet. Some advice would very much be appreciated. Possibly use individual classes ...
2
votes
0answers
45 views

Controller to execute AJAX requests for a client

I have been developing this structure or pattern (I don't really know how to call it). It's my first time doing something like this, and I'm a bit worried about the future, if it becomes unmanageable. ...
3
votes
0answers
27 views

Testing whether pages can be fetched from two ports

I have an endpoint in my API which does a port test on 4455 and 4456 once a client GET's it. This is accomplished by requesting two web pages. The result will respond to the client with a JSON object: ...
3
votes
2answers
160 views

Haskell API for accessing a SQLite database

I have a SQLite database, and I'm trying to make a web API for it. I've been writing it in Haskell, and using scotty as the server. I templated out the website from ...
1
vote
0answers
58 views

Plotting neighborhood Yelp information on Google Maps

I have a project that I made a long time ago, and I was wondering how I should refactor the front end. This web app gets yelp data and displays it on a google map. I remember someone saying that html ...
3
votes
0answers
93 views

Filtering OTC market data

It's been one month I do programming in python. Hence, my experience is a bit limited. Here is what I've done so far. The program is only filtering OTC market data according to certain features. Could ...
1
vote
0answers
72 views

JSON validator using rules

I'm writing an application that is meant to validate data. The data comes in the form of JSON and I'm using JSON Schema to validate the structure and some of the logic along with functions to ...