mirror of
https://github.com/jooray/nostr-scripts.git
synced 2026-05-03 06:51:40 +00:00
Read JSONL line by line
This commit is contained in:
parent
7dd1590399
commit
3fdca19d85
@ -9,7 +9,14 @@ if len(sys.argv) < 2:
|
|||||||
|
|
||||||
relay = sys.argv[1]
|
relay = sys.argv[1]
|
||||||
|
|
||||||
data = json.loads(sys.stdin.read())
|
data = []
|
||||||
|
for line in sys.stdin:
|
||||||
|
try:
|
||||||
|
item = json.loads(line)
|
||||||
|
data.append(item)
|
||||||
|
except json.JSONDecodeError as e:
|
||||||
|
print(f"Error decoding JSON: {e}", file=sys.stderr)
|
||||||
|
continue
|
||||||
|
|
||||||
# Execute the binary for each element in the JSON array
|
# Execute the binary for each element in the JSON array
|
||||||
for item in data:
|
for item in data:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user