]> git.evergreen-ils.org Git - contrib/pines/genasys.git/blob - templates/utility/ums/run-calls.pl
add Apache mutex-file configuration
[contrib/pines/genasys.git] / templates / utility / ums / run-calls.pl
1 #!/usr/bin/perl
2 use strict; use warnings;
3 use OpenSRF::AppSession;
4 use OpenSRF::System;
5 use OpenSRF::Utils::JSON;
6 require '/openils/bin/oils_header.pl';
7 use vars qw/$authtoken/;
8
9 my $days_back = 15;
10 my $fine_limit = '4.99';
11 my $method = 'open-ils.collections.users_of_interest.retrieve';
12
13
14 die "usage: $0 <config> <username> <password> <lib>" unless $ARGV[3];
15 osrf_connect($ARGV[0]);
16 oils_login($ARGV[1], $ARGV[2]);
17 my $lib = $ARGV[3];
18
19 my $ses = OpenSRF::AppSession->create('open-ils.collections');
20 my $req = $ses->request($method, $authtoken, $days_back, $fine_limit, $lib);
21 my @data;
22
23 while(my $resp = $req->recv(timeout=>7200)) {
24         push(@data, $resp->content);
25 }
26
27 open(F, ">data-$lib");
28 print F OpenSRF::Utils::JSON->perl2JSON(\@data);
29 close(F);
30