Read info from api website and show retrieved data


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Read info from api website and show retrieved data
# 1  
Old 04-12-2019
Read info from api website and show retrieved data

good evening,

i'm still new in scripting but i'm learning every day and i'm enjoying it.
so i have api website (
Code:
htt p://api.nobelprize.org/v1/prize.json

), i want to make a script that allows me to give it two arguments like ./test.sh 2005 physics, 2000 is for the year and physics is category and the result for example is like this:

Code:
./test.sh 2005 physics
Roy J. Glauber
John L. Hall
Theodor W. Hänsch

I don't how can i access the file from the internet, i installed an extension i found online for that using sudo apt-install jq but i dont know how to use it.

Thanks alot




Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by Neo; 04-14-2019 at 12:10 AM..
# 2  
Old 04-13-2019
Why are you doing this with a shell script?

Is this homework at school?

Web developers do not do this "grab JSON from the net and process it" using shell because there are more modern tools and languages to do this. CGI and shell was used decades ago. Now, we use modern tools made for this kind of processing.

So, I kindly ask you again, why are you doing this using a shell script like bash?

What are you planning to do with the data after you retrieve it using a RESTFUL API?

Do you want to block the processing (the script) while waiting for the network call to return?

If so, why are you not doing this API call asynchronously using an AJAX function? Or more "2019'ish", with an asynchronous promise?
This User Gave Thanks to Neo For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help Filtering Data from an API

Hi Everyone, I need help on figuring out a way to filter some data that I get back from an API. Im able to get all the data that Im looking for but I would like to know a way for me to filter it better. The data that Im getting back is basically 2 rows of data as seen here. Row 1 ... (25 Replies)
Discussion started by: TheStruggle
25 Replies

2. Shell Programming and Scripting

Grabbing data from a secured website

Hello there, I am a beginner in Perl, and I have a challenging project: I have to create a program that checks regularly on an online bank account for new operations, it should then feed a database keeping track of all the money going in and out. Of course the login details of this online... (4 Replies)
Discussion started by: freddie50
4 Replies

3. Shell Programming and Scripting

Need to run an API from a script and extract fields from output of API

Hi, I need to call an API (GetUsageDetails)from inside a shell script which takes an input argument acct_nbr. The output of API will be like : <usageAccum accumId="450" accumCaptn="PM_125" inclUnits="1410.00" inclUnitsUsed="744.00" shared="true" pooled="false" prorated="false"... (1 Reply)
Discussion started by: rkrish
1 Replies

4. UNIX for Advanced & Expert Users

Show all network info

Is there a command that display all network info. I'm looking for ip address, subnet mask, gateway, and dns. If there isn't a single command could someone please write me a shellscript that can do this? (8 Replies)
Discussion started by: cokedude
8 Replies

5. Shell Programming and Scripting

sort retrieved data files in different dirs

Hi, I have a script to retrieve data files from server and store them in a directory on local disk. The script runs everyday as cron job. But now those files are too many so my boss wants me to put the files into different directories base on dates. Those files look like this: ... (4 Replies)
Discussion started by: leafei
4 Replies

6. Shell Programming and Scripting

Unix Script to read the XML file from Website

Hi Experts, I need a unix shell script which can copy the xml file from the below pasted website and paste in in my unix directory. http://www.westpac.co.nz/olcontent/olcontent.nsf/fx.xml Thanks in Advance... (8 Replies)
Discussion started by: phani333
8 Replies

7. Shell Programming and Scripting

Using Python to grab data from a website

Hello Everyone, I'm trying to write a python script that will go to the following website and grab all the data on the page. The page refreshes regularly and the number of flights is different. Untitled Document What I wanted to do was grab all the data (except for top three row containing... (5 Replies)
Discussion started by: jl487
5 Replies

8. Shell Programming and Scripting

Store data from dynamic website table

hi everybody, Asking for something that I´m not sure if it´s possible to implement. I hope be clear enough. Well, my issue is that I´m looking how to copy or extract a particular table content of a website. I get the content from a external feed (Iframe format), the content is updated every... (1 Reply)
Discussion started by: cgkmal
1 Replies

9. Shell Programming and Scripting

Downloading info from website to database

Hi guys! I created a database using mysql in bash now i would like to download weather info from the data.(temp, date and time)...and just store this in the database to display after every 3 hours or so... i have tried to get the website using wget and now dont exactly now how to go from here... (0 Replies)
Discussion started by: vadharah
0 Replies
Login or Register to Ask a Question