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
5
votes
0answers
54 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
72 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
42 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
80 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
84 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
88 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
87 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
56 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
72 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
60 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
110 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
56 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
144 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
407 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
64 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
324 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
103 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
2k 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
337 views

Python script to query REST API and write to database

I wrote the following sample script for learning purposes: ...
0
votes
1answer
201 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
103 views

Namedtuple and list to populate each record of a JSON file

I had a JSON file in this format: ...
0
votes
3answers
222 views

Extracting information from JSON

Here is a simplified version of my JSON. ...
3
votes
0answers
32 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
18 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/...
2
votes
0answers
18 views

JSON Test Harness: Part 2

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

JSON Test Harness: Part 1

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

Recursive object/array filter by key

I have some code that takes some JSON, parses it, and given an optional filter, will attempt to find any key (or nested key) that includes the filter (partial matching - it does not match values). The ...
2
votes
2answers
235 views

Reading a gzipped file with JSON data for thousands of users

I'm a newbie in Python. I need to read a GZ file contains thousands of users. But I think my code is not optimized in this case. Could anyone can help me? What should I do to improve performance? Or ...
2
votes
1answer
128 views

Sorting function from a React app to display JSON data in a sortable table

I created this simple react application for a coding challenge, which is described in the linked README file. Basically, I created the components and helper logic to display dynamic JSON data in a ...
5
votes
1answer
155 views

Arabic language lesson program Part 2

This is the second time I am asking for a review of this code (first time can be found here: Arabic language lesson program). The goal of the program hasn't changed - to house Arabic language lessons ...
2
votes
1answer
1k views

Read gzipped JSON file from URL

I am requesting a JSON file that's gzipped. First, I download file: ...
0
votes
1answer
157 views

Parse JSON strings as tables using Python

Needed a simple CSV file that had headers and no nesting of data to consume in Tableau. The JSON file I was consuming had nested dictionaries and lists (which sometimes had in themselves nested lists/...
1
vote
1answer
189 views

Extracting a list of objects from a repository as JSON

Currently, I am using the below code to make JSON data from list of objects. ...
0
votes
1answer
141 views

Saving Reddit posts and comments from JSON into ArrayLists

I'm trying to get and save in an ArrayList Reddit posts and comments. The code is very similar for both: The RedditThing is a parent of RedditPost and RedditComment: ...
1
vote
0answers
84 views

Python Text RPG Item Management System (with CLI tool for creating JSON files)

I've been working on a full RPG skeleton for a while, and I've just now reached a point on the module dealing with items where I feel comfortable sharing. My intent was to create a structure for the ...
1
vote
0answers
70 views

Simple json config provider

I'm pretty new to this so constructive criticism is acceptable. I'm trying to find any way I can improve this system, all it does is take a string, determine if that string is a web address or a file ...
2
votes
1answer
59 views

PHP RSS/XML reader basic class

I write this class to process and output xml/rss feeds. I'm still working on, but any suggestion will be appreciated. As a little trick if the xml file come from an online resource, I've added a ...
0
votes
1answer
53 views

Python client to fetch JSON data from REST API, retrying on failure

As a beginner, I'd like to see if anyone can suggest any better way of coding the below, as I'm duplicating code and nesting identical if statements as part of the following problem. I'm grabbing ...
6
votes
0answers
113 views

Using decorated methods in a subclass of deque to dump its state to a JSON file

I am sub-classing an object in python and I need to overload a bunch of the methods with very similar logic, essentially a call to super() and then some additional operations. I want to avoid ...
3
votes
2answers
925 views

Using Python to create a JSON file of recipes from MySQL

I needed to create a JSON file from a couple of MySQL tables to migrate some recipes from wordpress. This was my first time writing a script in python and would like to get some feedback on what I ...
1
vote
2answers
102 views

Encoding multiple rows from prepared statement in php [closed]

I have this code that hypothetically returns multiple rows from a database and encodes them in a JSON. I am wondering if this is the best and most presentable way to do it. Note: I am using msqli ...
2
votes
0answers
26 views

Looping JSON to get matching values from Database

I have a need to take in a payload that looks like this: ...
2
votes
1answer
92 views

Updating entries in a JSON file

I have the following Data.json file and I would like to update some of the values. ...
7
votes
1answer
191 views

HoloLens Unity program

I recently finished writing an HoloLens proof-of-concept program. It involves generating a user interface based on a connection with an OPC server. OPC involves industrial PLCs, one or more PLCs send ...