Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
esp32
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
esp32
Commits
dddb1843
Commit
dddb1843
authored
Jun 18, 2017
by
omwansafelix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get data for broadcast_url from Bitsoko server and parse it to a json file for use.
parent
abb35460
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
get_urldata.sh
Test Folder/get_urldata.sh
+51
-0
No files found.
Test Folder/get_urldata.sh
0 → 100644
View file @
dddb1843
#Author: Felix Omwansa
##buildESP32_update: get data for broadcast_url from Bitsoko server
##Parsing a json response of a url to a file
##installing jq: a command-line JSON processor
echo
""
echo
"[
$0
]: installing jq: a command-line JSON processor"
echo
"[
$0
]: Checking for system prerequisites and installing the required toochain..."
sleep
3
echo
""
#Archlinux
if
[
$(
which pacman
)
]
then
echo
"[
$0
]: Found archlinux based system."
sudo
pacman
-Sy
jq
fi
#Ubuntu
if
[
$(
which apt-get
)
]
then
echo
"[
$0
]: Found Ubuntu based system."
sudo
apt-get update
sudo
apt-get
install
jq
fi
#Any other system goes here
echo
""
echo
"[
$0
]: getting json response from Bitsoko server..."
sleep
3
RESP
=
$(
curl
-s
'https://bitsoko.io/devices/?dID=46e3e4f0c3f8889d'
2>&1
)
echo
""
echo
"[
$0
]: creating json file to store response..."
sleep
3
if
[
-f
test.json
]
then
rm
test.json
fi
#create json file to store response
echo
"
${
RESP
}
"
| jq
.
>>
test.json
echo
"[
$0
]: url data : "
jq
-r
'.[].name'
test.json
#prints value of 'name'
sleep
3
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment