in reply to Re^2: Perl Database Entries
in thread Perl Database Entries
If i were doing it, i'd skip curl and use LWP, then JSON
As that may turn out to be too much for you you might want to skip jg. at least. Something like
$api_results=`curl -H "Authorization: token 5FEFAQ1W4" https://www.b +om/api/v2/organizations/company/admin/groups/"$groid"/installations?p +age=1`; use JSON; my $json=new JSON; my $unjson=$json->allow_nonref->decode($api_results); $app_insert = $dbh->prepare("INSERT IGNORE INTO apps(id, app_slug, a +pp_Name, provider_id, provider_slug, provider_saml, config_saml, conf +ig_login, config_url, created_date, status, key_vault, mfa_code) VALU +ES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?") or die $dbh->errstr; for my $row (@$unjson) { my @insert; for my $var (qw/.id .slug .name .provider.id .provider.name .provider.capabilities.has_saml .configuration.sam +l .configuration.login .configuration.install_type .created .keyvault .requires_mfa_code /){ push @insert,$row->{$var}; } # var $app_insert->execute(@api) or die $app_insert->errstr; } # row
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl Database Entries
by cbtshare (Monk) on Jul 16, 2017 at 05:23 UTC | |
by huck (Prior) on Jul 16, 2017 at 05:34 UTC | |
by cbtshare (Monk) on Jul 16, 2017 at 06:51 UTC | |
by huck (Prior) on Jul 16, 2017 at 08:15 UTC | |
by cbtshare (Monk) on Jul 16, 2017 at 20:39 UTC | |
| |
by poj (Abbot) on Jul 16, 2017 at 08:15 UTC | |
by cbtshare (Monk) on Jul 16, 2017 at 20:42 UTC | |
|
Re^4: Perl Database Entries
by cbtshare (Monk) on Jul 15, 2017 at 14:45 UTC |