Why jq hard (it probably isn't but I am trying to take shortcuts and make a solution that works without knowing too much what I am exactly doing :p)
-
@MagicLike jq is a waste of time tbh
@catraxx then please give me a better and easier option to process JSON
-
@catraxx then please give me a better and easier option to process JSON
@MagicLike Process it how? Just adding the json into an array or something?
-
@MagicLike Process it how? Just adding the json into an array or something?
@catraxx no, taking the JSON out of an API (via curl), then extracting all array objects with a specific value of one property and then extracting a code out of another property in those already extracted objects. Those codes then need to be inserted into a POST request one by one.
-
@catraxx no, taking the JSON out of an API (via curl), then extracting all array objects with a specific value of one property and then extracting a code out of another property in those already extracted objects. Those codes then need to be inserted into a POST request one by one.
@catraxx this resembles somewhat the JSON input I am working with
{
...
"results": [
{
"code": "CODE1",
...
"status": "y",
...
},
{
"code": "CODE2",
...
"status": "n",
...
}
]
} -
@catraxx no, taking the JSON out of an API (via curl), then extracting all array objects with a specific value of one property and then extracting a code out of another property in those already extracted objects. Those codes then need to be inserted into a POST request one by one.
@MagicLike Axios can be used for api communication. If you simply safe the output to a json file you can then just fetch it, which caches the data and you can iterate it normally.
-
@catraxx this resembles somewhat the JSON input I am working with
{
...
"results": [
{
"code": "CODE1",
...
"status": "y",
...
},
{
"code": "CODE2",
...
"status": "n",
...
}
]
} -
@MagicLike Axios can be used for api communication. If you simply safe the output to a json file you can then just fetch it, which caches the data and you can iterate it normally.
@catraxx okay what is axios o.o
(I am trying to do all of this in a bash/shell script) -
@catraxx okay what is axios o.o
(I am trying to do all of this in a bash/shell script)@MagicLike In a shell script? I thouught we were talking about jquery because you mentioned javascript earlier. In shell it should be easier?
-
@catraxx okay uhhm I need this to not be JS, but rather independent and preferably just a cronjob-triggered script
-
@catraxx okay uhhm I need this to not be JS, but rather independent and preferably just a cronjob-triggered script
@MagicLike Right, as i just said, jq means two things lol
-
@MagicLike In a shell script? I thouught we were talking about jquery because you mentioned javascript earlier. In shell it should be easier?
@catraxx heh yeah the js part was the second part of this but now I need to make API calls every few seconds to make the same software even usable for my purpose, the js stuff was just for improved UX
-
@MagicLike Right, as i just said, jq means two things lol