Laurielounge has asked for the wisdom of the Perl Monks concerning the following question:
I'm using a database query to determine what the request parameters should be for this query. The multi line result set looks like$req = $analytics->new_request( realtime => "true", ids => "ga:12345678", dimensions =>"rt:country,rt:city,rt:pagePath, rt:latitude, rt:longitude", metrics =>"rt:activeUsers", filters =>"rt:country==England", );
Or to show it another way:Record 1 realtime => "true", Record 2 ids => "ga:12345678", Record 3 dimensions =>"rt:country,rt:city,rt:pagePath,rt:latitude,rt:l +ongitude", Record 4 metrics =>"rt:activeUsers", Record 5 filters =>"rt:country==England",
So. If I created a string along the lines ofrealtime => "true", ids => "ga:12345678", dimensions =>"rt:country,rt:city,rt:pagePath,rt:latitude,rt:longitude" +, metrics =>"rt:activeUsers", filters =>"rt:country==England",
(in reality it's$qry_str = 'realtime => "true", ids => "ga:12345678", dimensions =>"rt:country,rt:city,rt:pagePath,rt:latitude,rt:longitude +", metrics =>"rt:activeUsers", filters =>"rt:country==England",';
)while ( @row = $sth->fetchrow_array() ) { $qry_str .= $row[0]; }
Any thoughts?$req = $analytics->new_request( $qry_str );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing API params via string
by LanX (Saint) on Sep 11, 2017 at 23:17 UTC | |
by Laurielounge (Acolyte) on Sep 11, 2017 at 23:53 UTC |