From 413bd25d2288ab95e9b311befdf47f21ea497e48 Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 20 May 2024 04:16:17 -0700 Subject: [PATCH] latest --- Makefile | 4 +++ fetch_api.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 3 +++ main.go | 68 ++++++++++++++++++++++---------------------------- 4 files changed, 107 insertions(+), 38 deletions(-) create mode 100644 Makefile create mode 100755 fetch_api.sh create mode 100644 go.mod diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7f06f77 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +default: run + +run: + go run main.go diff --git a/fetch_api.sh b/fetch_api.sh new file mode 100755 index 0000000..0a18db7 --- /dev/null +++ b/fetch_api.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +# Ensure both cursor and limit arguments are provided +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +cursor=$1 +limit=$2 + +# Construct the JSON payload with the provided cursor and limit +json_payload=$(cat <