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


In reply to Re^3: Perl Database Entries by huck
in thread Perl Database Entries by cbtshare

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.