forked from DAGWorks-Inc/burr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df6b8ef
commit 236d76d
Showing
4 changed files
with
85 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Default to the 'social_media_post' endpoint if no argument is passed | ||
ENDPOINT="social_media_post" | ||
if [[ "$1" == "streaming_async" ]]; then | ||
ENDPOINT="social_media_post_streaming_async" | ||
elif [[ "$1" == "streaming" ]]; then | ||
ENDPOINT="social_media_post_streaming" | ||
fi | ||
|
||
# Perform the curl request to the chosen endpoint | ||
curl -X 'GET' "http://localhost:7443/$ENDPOINT" \ | ||
-s -H 'Accept: application/json' \ | ||
--no-buffer | jq --unbuffered -c '.' | while IFS= read -r line; do | ||
if [[ "$line" != "" ]]; then # Check for non-empty lines | ||
clear | ||
echo "$line" | jq --color-output . | ||
sleep .01 # Add a small delay for visual clarity | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters