[csw-devel] SF.net SVN: opencsw:[527] buildfarm/bin

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Tue Sep 6 11:05:10 CEST 2011


Revision: 527
          http://opencsw.svn.sourceforge.net/opencsw/?rev=527&view=rev
Author:   dmichelsen
Date:     2011-09-06 09:05:10 +0000 (Tue, 06 Sep 2011)
Log Message:
-----------
wikidot integration update

Modified Paths:
--------------
    buildfarm/bin/list-experimental
    buildfarm/bin/wikidot

Modified: buildfarm/bin/list-experimental
===================================================================
--- buildfarm/bin/list-experimental	2011-09-06 09:04:31 UTC (rev 526)
+++ buildfarm/bin/list-experimental	2011-09-06 09:05:10 UTC (rev 527)
@@ -29,7 +29,7 @@
 #   http://www.wikidot.com/doc:api
 my $cli = RPC::XML::Client->new("https://webcsw:${pass}\@www.wikidot.com/xml-rpc-api.php");
 $RPC::XML::ALLOW_NIL = 1;
-my $req = RPC::XML::request->new( "site.pages", {'site' => 'opencsw'} );
+my $req = RPC::XML::request->new( "pages.select", {'site' => 'opencsw'} );
 my $resp;
 $resp = $cli->send_request($req);
 
@@ -37,9 +37,22 @@
 my %projects;
 if( defined $resp ) {
   if( ref $resp ) {
-    foreach my $page (@{$resp->value}) {
-      if( $page->{name} =~ /^project-(.*)/ ) {
-        $projects{lc $1} = $page;
+    my @pages = grep { /^project-/ } @{$resp->value};
+    while( @pages > 0 ) {
+      my @rpages = splice( @pages, 0, 10 );
+      my $req2 = RPC::XML::request->new( "pages.get_meta", {'site' => "opencsw", 'pages' => \@rpages });
+      my $resp2 = $cli->send_request($req2);
+      if( defined $resp2 ) {
+        if( ref $resp2 ) {
+          foreach my $p (keys %$resp2) {
+            if( $p =~ /^project-(.*)/ ) {
+              $projects{lc $1}->{name} = $p;
+              $projects{lc $1}->{title} = $resp2->{$p}->{title}->value;
+            }
+          }
+        } else {
+          print "Error: $resp2\n";
+        }
       }
     }
   } else {

Modified: buildfarm/bin/wikidot
===================================================================
--- buildfarm/bin/wikidot	2011-09-06 09:04:31 UTC (rev 526)
+++ buildfarm/bin/wikidot	2011-09-06 09:05:10 UTC (rev 527)
@@ -23,7 +23,8 @@
 
 #my $req = RPC::XML::request->new( "site.pages",
 #        {'site' => RPC::XML::string->new("opencsw")});
-my $req = RPC::XML::request->new( "site.pages", {'site' => "opencsw" });
+#my $req = RPC::XML::request->new( "site.pages", {'site' => "opencsw" });
+my $req = RPC::XML::request->new( "pages.select", {'site' => "opencsw" });
 
 $RPC::XML::ALLOW_NIL = 1;
 
@@ -31,3 +32,46 @@
 print Dumper( $resp );
 # print ref $resp ? join(', ', grep { /project/ } map { $_->{name} } @{$resp->value}) : "Error: $resp\n";
 
+my $req3 = RPC::XML::request->new( "pages.get_one", {'site' => "opencsw", 'page' => 'perl-dublin' });
+my $resp3 = $cli->send_request($req3);
+print Dumper( $resp3 );
+
+open F, ">/opt/csw/apache2/share/htdocs/buildfarm/perl-dublin.html";
+print F $resp3->{html}->value;
+close F;
+
+__END__
+
+
+my @pages = grep { /^project-/ } @{$resp->value};
+my %projects;
+while( @pages > 0 ) {
+  my @rpages = splice( @pages, 0, 10 );
+  my $req2 = RPC::XML::request->new( "pages.get_meta", {'site' => "opencsw", 'pages' => \@rpages });
+  my $resp2 = $cli->send_request($req2);
+  foreach my $p (keys %$resp2) {
+    if( $p =~ /^project-(.*)/ ) {
+      $projects{lc $1}->{name} = $p;
+      $projects{lc $1}->{title} = $resp2->{$p}->{title};
+    }
+  }
+# print Dumper( $resp2 );
+}
+
+print Dumper( %projects );
+
+__END__
+
+my %projects;
+if( defined $resp ) {
+  if( ref $resp ) {
+    foreach my $page (@{$resp->value}) {
+      if( $page =~ /^project-(.*)/ ) {
+        $projects{lc $1}->{name} = $page;
+      }
+    }
+  } else {
+    print "Error: $resp\n";
+  }
+}
+

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list