Sponsored Content
Top Forums Shell Programming and Scripting Read info from api website and show retrieved data Post 303033872 by kalbsghir on Friday 12th of April 2019 05:51:47 PM
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..
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Jifty::API(3pm) 					User Contributed Perl Documentation					   Jifty::API(3pm)

NAME
Jifty::API - Manages and allow reflection on the Jifty::Actions that make up a Jifty application's API SYNOPSIS
# Find the full name of an action my $class = Jifty->api->qualify('SomeAction'); # New users cannot run some actions if (Jifty->web->current_user->age < 18) { Jifty->api->deny(qr/Vote|PurchaseTobacco/); } # Some users cannot even see some actions if (Jifty->web->current_user->id > 10) { Jifty->api->hide('Foo'); Jifty->api->show('FooBar'); Jifty->api->hide('FooBarDeleteTheWorld'); } # Fetch the class names of all actions my @actions = Jifty->api->all_actions; # Fetch the class names of all the allowed actions my @allowed = Jifty->api->actions; # Fetch all of the visible actions (some of which may not be allowed) my @visible = Jifty->api->visible_actions; # Check to see if an action is allowed if (Jifty->api->is_allowed('TrueFooBar')) { # do something... } # Check to see if an action is visible if (Jifty->api->is_visible('SpamOurUsers')) { SpamBot->be_annoying; } # Undo all allow/deny/restrict/hide calls Jifty->api->reset; DESCRIPTION
You can fetch an instance of this class by calling "api" in Jifty in your application. This object can be used to examine the actions available within your application and manage access to those actions. METHODS
new Creates a new "Jifty::API" object. Don't use this, see "api" in Jifty to access a reference to "Jifty::API" in your application. qualify ACTIONNAME Returns the fully qualified package name for the given provided action. If the "ACTIONNAME" starts with "Jifty::" or "ApplicationClass::Action", simply returns the given name; otherwise, it prefixes it with the "ApplicationClass::Action". reset Resets which actions are allowed to the defaults; that is, all of the application's actions, Jifty::Action::AboutMe, Jifty::Action::Autocomplete, and Jifty::Action::Redirect are allowed and visible; everything else is denied and hidden. See "restrict" for the details of how limits are processed. deny_for_get Denies all actions except Jifty::Action::AboutMe, Jifty::Action::Autocomplete and Jifty::Action::Redirect. This is to protect against a common cross-site scripting hole. In your "before" dispatcher rules, you can whitelist actions that are known to be read-only. This is called automatically during any "GET" request. allow RESTRICTIONS Takes a list of strings or regular expressions, and adds them in order to the list of limits for the purposes of "is_allowed". See "restrict" for the details of how limits are processed. Allowing actions also "show" them. deny RESTRICTIONS Takes a list of strings or regular expressions, and adds them in order to the list of limits for the purposes of "is_allowed". See "restrict" for the details of how limits are processed. hide RESTRICTIONS Takes a list of strings or regular expressions, and adds them in order to the list of limits for the purposes of "is_visible". See "restrict" for the details of how limits are processed. Hiding actions also "deny" them. show RESTRICTIONS Takes a list of strings or regular expressions, and adds them in order to the list of limits for the purposes of "is_visible". See "restrict" for the details of how limits are processed. restrict POLARITY RESTRICTIONS Method that "allow", "deny", "hide", and "show" call internally; POLARITY is one of "allow", "deny", "hide", or "show". Limits are evaluated in the order they're called. The last limit that applies will be the one which takes effect. Regexes are matched against the class; strings are fully /qualify and used as an exact match against the class name. The base set of restrictions (which is reset every request) is set in "reset", and usually modified by the application's Jifty::Dispatcher if need be. If you call: Jifty->api->deny ( qr'Foo' ); Jifty->api->allow ( qr'FooBar' ); Jifty->api->deny ( qr'FooBarDeleteTheWorld' ); ..then: calls to MyApp::Action::Baz will succeed. calls to MyApp::Action::Foo will fail. calls to MyApp::Action::FooBar will pass. calls to MyApp::Action::TrueFoo will fail. calls to MyApp::Action::TrueFooBar will pass. calls to MyApp::Action::TrueFooBarDeleteTheWorld will fail. calls to MyApp::Action::FooBarDeleteTheWorld will fail. is_allowed CLASS Returns true if the CLASS name (which is fully qualified if it is not already) is allowed to be executed. See "restrict" above for the rules that the class name must pass. is_visible CLASS Returns true if the CLASS name (which is fully qualified if it is not already) is allowed to be seen. See "restrict" above for the rules that the class name must pass. decide_action_polarity CLASS, ALLOW, DENY Returns true if the CLASS name it has the ALLOW restriction, false if it has the DENY restriction. This is a helper method used by "is_allowed" and "is_visible". If no restrictions apply to this action, then false will be returned. explain CLASS Returns a string describing what allow, deny, show, and hide rules apply to the class name. all_actions Lists the class names of all actions for this Jifty application, regardless of which are allowed or hidden. See also "actions" and "visible_actions". actions Lists the class names of all of the allowed actions for this Jifty application; this may include actions under the "Jifty::Action::" namespace, in addition to your application's actions. See also "all_actions" and "visible_actions". visible_actions Lists the class names of all of the visible actions for this Jifty application; this may include actions under the "Jifty::Action::" namespace, in addition to your application's actions. See also "all_actions" and "actions". SEE ALSO
Jifty, Jifty::Web, Jifty::Action LICENSE
Jifty is Copyright 2005-2010 Best Practical Solutions, LLC. Jifty is distributed under the same terms as Perl itself. perl v5.14.2 2011-05-18 Jifty::API(3pm)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy