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
0answers
343 views

Mapping nested arrays from API response

I have some selects on my html page that I want to populate with the response from my backend API. The response looks like this JSON response ...
-1
votes
1answer
98 views

Read JSON files, basic calculations and write over another JSON file

Class SectorController calculates weight coefficients for sector performances in equity exchange markets using minute data from an API (for instance, if a group of ...
0
votes
0answers
48 views

Fetch the multiple images from JSON using foreach

I am fetching the images & its positions from JSON using foreach.... Is there any way i can improve code standard for performance & other things.... https://codepen.io/kidsdial/pen/EMQVqK ...
8
votes
1answer
208 views

Recursive parser from Binary to JSON output

Background I got this interview test and got declined due to not meeting their expectations, but never got a reason on what was bad and how they solved it. I want to improve and learn something out ...
1
vote
0answers
133 views

jenkins deployment making the build very slow

I am new to Jenkins. I am doing a build through Jenkins, but the build is very slow. Is there any way I can speed it up? ...
7
votes
1answer
102 views

Web-scraping C.R. Laurence product catalog

In the last couple of days I've tried to play around with some scraping using XPATHs and Python to consolidate my knowledge (since it's been some time). I did this on a simple website which doesn't ...
1
vote
2answers
109 views

Pretty print an object - JavaScript

I've written a function to prettify a json object, as if it were using JSON.stringify. I'm only focused on strings and other objects, nothing else. Is there a better way of doing this? perhaps using ...
3
votes
1answer
236 views

Convert bitcoin value based on exchange rate from JSON API

I’m learning F# and trying to find a more ‘functional’ way to code a simple program that retrieves the price of BTC and calculates the EUR value of an amount of Bitcoin. ...
3
votes
0answers
686 views

Deserializing JSON with Utf8JsonReader

Path of Exile is a PC game where players can list their items for sale. The game has a public API that serves JSON which contains all of these items. My application consumes that JSON and indexes the ...
1
vote
1answer
130 views

Embedding an HTML (String) Generated from a Tree Structure JSON

How to make insertJson faster (I should keep the script compatible with old versions of IE and other browsers)? Sorry about my codes that I had to write with short ...
4
votes
2answers
190 views

PHP script that writes a JSON file with iextrading API data

iextrading has two APIs (v1, v2) which provide financial market data. Following script records a JSON file with their equity information (using a CRON job). Would you be kind and review it for any ...
1
vote
0answers
34 views

PHP API Query using CURL and return JSON

Fairly new to writing PHP. I want some PHP code to query an API with a post request, set specific headers and message body, and echo out the JSON response. This is the code I have come up with, which ...
3
votes
0answers
59 views

MySQL JSON diff procedure

I'm building a procedure which compares two JSON objects and return two JSON objects with differences between each (compared keys and values). But I have relatively superficial SQL knowledge, so I ...
2
votes
0answers
49 views

Parsing potentially nonexistant JSON fields in JavaScript

Context: I'm currently toying with the Google Geocode API to break down address strings into a more machine-friendly format. The problem is that neither the user input or API output are 100% ...
1
vote
1answer
553 views

React table with JSON

I'm pretty new to React and I was working on some JSON data. Now I just to understand basic concepts, so I wrote this little component, but in my eyes it's not efficient. ...
3
votes
1answer
76 views

Mini HttpClient json post by Action parameter

This is an implementation of HttpClient Json Post by Action parameter. Logic: It is mainly convenient to pass the url and object (automatically converted to json by Json.Net), and can use ...
3
votes
1answer
75 views

CSV/JSON converter

This is my first Python script and I would like to hear the opinion of more experienced users, so I can do it right from the beginning instead of trying to correct my mistakes after months (years?) of ...
0
votes
0answers
35 views

Templated JSON parsing methods that work with an element or elements array

Consider the following two Java methods. The first takes a JSON string representing one element, the second representing multiple elements. gson.fromJson() can be ...
2
votes
1answer
45 views

RESTful API echo server using Python bottles

I just wrote an echo server that responds to curl requests with the method used and the data sent. Sticking to GET and POST for now, but I would like to know if there's something I can do to improve ...
6
votes
1answer
151 views

Read jobs from jobs.af (a jobs portal), categories them and write them to separate CSV files based on jobs gender

I am a beginner Python developer and I wrote a script in Python which fetches 50 latest jobs from jobs.af (a jobs portal) API, categories them based on jobs gender and write each to a separate CSV and ...
6
votes
0answers
73 views

Finding unimplemented tasks on Rosetta Code using Requests

This is a Find unimplemented tasks task from Rosetta Code: Given the name of a language on Rosetta Code, find all tasks which are not implemented in that language. There is already a solution ...
4
votes
1answer
103 views

DigitalOcean dynamic DNS update script

Inspired by a shell script I saw on Github, I put together a Python version to update the dynamic IP address for a subdomain I have that uses DigitalOcean's nameservers. I added a check to see if the ...
1
vote
0answers
46 views

Java classes to load configuration data from a JSON file, with Scala tests

I want to implement classes in a project that will support the loading of configuration data from a JSON file. The JSON file is in the following form. Please be as critical as you can be. I'm a junior ...
2
votes
1answer
41 views

Create a separate JSON + syntax

My code already works perfectly. Here is the JS file: ...
3
votes
2answers
129 views

Reducing the amount of List in a WebScraper

At the moment, I'm learning and experimenting on the use of web scraping content from different varieties of web pages. But I've come across a common smelly code among several of my applications. I ...
2
votes
1answer
81 views

Unquoting booleans, numbers, etc. in a JSON string

I have a method that takes a JSON string as input and "fixes" it. By that, I mean, that the JSON string comes in with all values quoted. My method un-quotes the values that shouldn't be quoted (i.e. ...
4
votes
2answers
87 views

GitHub repo tree generator

I have built a generator that, using the GitHub API, creates a dictionary containing a tree of all the resources in any GitHub repo. It uses the function git_tree, ...
15
votes
2answers
2k views

Minecraft block generator

This script is a tool to help minecraft mod development. When you want to add a new block to the game you have to create three json files. This script generates three JSON files in specific locations. ...
4
votes
1answer
92 views

Hangman program w/ Python and JSON

What improvements can I make? Should I organize my functions based on A-Z? For example, find_letter function comes before guessing function. ...
5
votes
1answer
101 views

A Korean (Language) Dictionary

Function : User enters a word in korean and the program translates (defines) it in english. What improvements can I make? Extra : What other challenges would you recommend that ...
3
votes
2answers
58 views

Storing statistics as JSON in a simulation game

I am working on a choice-based simulation and players have to choose between different locations, I am pushing those choices to an array locationLog and my ...
1
vote
1answer
46 views

Wrapping certain elements in an array with an array with PHP

I have a function that's doing this correctly, but I feel as though this can be done (possibly) with minimal code, with recursion, but I'm just wracking my brain. Basically I have JSON that gets ...
3
votes
0answers
91 views

Using Python threads to download images

I am using Python threads to download images. I have a JSON file that contains URLs to the images in the following structure: ...
4
votes
2answers
61 views

Serial copying from disk images to folder in Bash

This is a Bash script that copies files stored inside disk images to a directory, using a defined structure provided via a JSON file. I've included the external programs it requires and the test I ...
3
votes
0answers
65 views

Network abstraction layer for a JavaScript JSON API client

I'm rewriting collection-json.js, a client for Collection+JSON. (Collection+JSON is a HATEAOS API media type built on top of JSON.) My Goals: Remove CoffeeScript webpack UMD so it can be used via ...
0
votes
2answers
36 views

Printing the status of a database insertion as JSON

The controller is currently inserting a record into the database and returning a JSON response as shown below in the try-catch block. I can see the ...
3
votes
3answers
111 views

Showing statistics of popular JavaScript frameworks from GitHub API

I am currently working on a simple app to check the stats of popular javascript frameworks. For this I am using the Github API to get certain data sets and have come close to finishing my project. <...
2
votes
1answer
58 views

JSON variable renamer

I made this program to rename variables in json files, part of the functions rely on recursivity which i'm not confortable with so I would like some feedback on readability and performance. ...
5
votes
0answers
169 views

Chaining JSON transformations with visitors

I have currently two use-cases that require JSON transformations before it can be deserialized. The first use-case requires changing the custom short type property name from ...
2
votes
4answers
578 views

Using JSON file for employee pay data

I'm looking for some feedback on my code here. I want to eliminate duplicating the code through the different button_clicks. I'm thinking with a method but nothing ...
-1
votes
1answer
68 views

Getting data from REST API (JSON), extract variables and upload those to database using MySQL [closed]

I'm working with a REST API, first time doing this and I have a working code but it's long and just looks messy to me. I just know there's a better and faster way to do it. ...
3
votes
0answers
413 views

Python script for OpenStack health check

First time moving from Bash to Python for scripting and looking for feedback/improvements. I've spent the weekend learning about OOP, and am aware that not fully utilizing it in this script — so any ...
0
votes
2answers
110 views

Web scraping and speeding up performance

I was wondering if the following code could be altered to speed up the scraping process. I know xrp has many transactions, but it takes an hour to go through half a day of transactions (at the busiest ...
2
votes
2answers
3k views

Getting a JObject by a property value

I am building a contact management system. Each contact can relate to the business in one of three ways: client, service provider, and third party. I have a JSON file containing the relation types ...
0
votes
1answer
564 views

Python script to query REST API and write to database

I wrote the following sample script for learning purposes: ...
1
vote
1answer
357 views

Converting employee survey data from CSV to JSON

This Java code project was submitted for a job opportunity but was marked down for showing "bad habits that could be difficult to unlearn" but I am mystified by what this means. Any takers please. How ...
0
votes
1answer
141 views

Namedtuple and list to populate each record of a JSON file

I had a JSON file in this format: ...
1
vote
3answers
387 views

Extracting information from JSON

Here is a simplified version of my JSON. ...
3
votes
0answers
33 views

JSON Test Harness: Part 4

Part 1: JSON Test Harness: Part 1 Part 2: JSON Test Harness: Part 2 Part 3: JSON Test Harness: Part 3 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
2
votes
0answers
19 views

JSON Test Harness: Part 3

Part 1: JSON Test Harness: Part 1 Part 2: JSON Test Harness: Part 2 Part 4: JSON Test Harness: Part 4 Time to review some test harness code I have written. https://github.com/Loki-Astari/...