[Bio] / FigKernelPackages / ACHserver.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ACHserver.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Mon May 11 19:06:39 2009 UTC revision 1.5, Tue Jun 30 19:02:29 2009 UTC
# Line 1  Line 1 
1    
2  package ACHserver;  package ACHserver;
3    
4    #
5    # This is a SAS Component
6    #
7    
8  use LWP::UserAgent;  use LWP::UserAgent;
9  use Data::Dumper;  use Data::Dumper;
10  use YAML;  use YAML;
11    
12  use strict;  use strict;
13    
14    #
15    # This is a SAS Component
16    #
17    
18    
19  sub new  sub new
20  {  {
21      my($class, $server_url) = @_;      my($class, $server_url) = @_;
22    
23      $server_url = "http://bio-macpro-1.mcs.anl.gov/~disz/FIG/ach_server.cgi" unless $server_url;      $server_url = "http://servers.nmpdr.org/ach/server.cgi" unless $server_url;
24    
25    #    $server_url = "http://bio-macpro-2.mcs.anl.gov/~disz/FIG/ach_server.cgi" unless $server_url;
26      #$server_url = "http://bio-macpro-1.mcs.anl.gov/ross-proj/FIG/co_occurs_server.cgi" unless $server_url;      #$server_url = "http://bio-macpro-1.mcs.anl.gov/ross-proj/FIG/co_occurs_server.cgi" unless $server_url;
27    
28      my $self = {      my $self = {
# Line 50  Line 61 
61              }              }
62  }  }
63    
64    sub run_query_bad
65    {
66        my($self, $function, @args ) = @_;
67    
68                my $arg_string = Dump(@args);
69                my $form = [function => $function,
70                            args => "$arg_string"];
71    
72                my $res = $self->{ua}->post($self->{server_url}, $form);
73                if ($res->is_success)
74                {
75    print Dumper $res;
76                    my $rc;
77                    eval {
78                        $rc = Load($res->content);
79                    };
80                    if ($@)
81                    {
82                        die "Bad YAML parse $@ on input\n" .  $res->content;
83                    }
84                }
85                else
86                {
87                    die "error on post " . $res->status_line . " " . $res->content;
88                }
89    }
90    
91    
92  1;  1;
93    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3