mirror of
https://github.com/jooray/nostr-scripts.git
synced 2026-01-03 06:15:31 +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]
|
||||
|
||||
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
|
||||
for item in data:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user