Hi Kang-min,
I don't know if you noticed, but SourceForge changed their look and feel yesterday. Unfortunately, this had the effect of breaking WWW::SourceForge rather severely. Attached is a patch that partially fixes up WWW::SourceForge::Project.
This fixes the loading of the description, detection of invalid projects, and the MailingList code. It doesn't fix the admin listing though, so you will want to look at that. With these changes, tests 1, 2, and 4 now work, but 3 does not.
I'm also attaching a new test file for you for the MailingList code, 5.mailstats.t. I figured this breakage was a good opportunity to write tests. ;-)
Anyway, hope this helps. Thanks again for the module! Bryce
On Wed, Aug 31, 2005 at 10:19:06AM +0800, Kang-min Liu wrote:
On 8/20/05, Bryce Harrington <bryce@...1...> wrote:
Hi Kang-min,
I noticed when installing WWW::SourceForge through cpan, that it fails to install due to one of the tests that requires YAML.pm. Below is a little patch that adds this as a requirement to the Makefile.PL:
Thank you :)
Btw, what I'm working on is a perl module for downloading files out of the SourceForge file tracker. We need an ability to automatically download new versions of packages we use for testing (such as the monthly LTP releases), but SourceForge's mirror system has made this a convoluted process. (I want to try to design my module to be compatible with yours so users could use both together if they want.)
This is one thing wanted in WWW::SourceForge. I didn't write such feature. If you're willing to do it, maybe we should put a releases() method in WWW::SourceForge::Project.
But,IMHO, for the new-releases polling, I suggest that you put this into another module, like POE::Component::SourceForge or something, and let WWW::SourceForge be only a front-end to the website.
-- ??? Cheers, Kang-min Liu
--- WWW-SourceForge-0.09/lib/WWW/SourceForge/Project.pm 2005-10-06 20:07:01.000000000 -0700 +++ WWW-SourceForge-0.09-patched/lib/WWW/SourceForge/Project.pm 2005-11-16 10:53:13.000000000 -0800 @@ -47,18 +47,34 @@ my $proj; my $wa = WWW::Mechanize->new( autocheck => 1); $wa->get($url); - my $content = $wa->content; + my $content = $wa->content or die "Could not retrieve content from '$url'\n";
# Wrong project unixname ? if($content =~ m{<H2><font color="#FF3333">Invalid Project</font></H2>}i) { - return; + warn "Invalid project '$pname'\n"; + return undef; + } elsif ($content =~ m{<H2 class="error">Invalid Project</H2>}i) { + warn "Invalid project '$pname'\n"; + return undef; }
+ + # Project description - my ($desc,$meta) = $content =~ m{<HR SIZE="1" NoShade><BR> -[\s\n]*<TABLE WIDTH="100%" BORDER="0"> -[\s\n]*<TR><TD WIDTH="99%" VALIGN="top"> -[\s\n]*<p>(.+?)<UL>(.+?)</UL>}s; + my ($desc) = $content =~ m{<div class="tbox"> + <h3>About .+?</h3> + </div> + <b class="tbtm"><b class="t2 tbg"></b><b class="t1 tbg"></b></b> + </div> + <p> + (.+?) + + </p>}is; + + # TODO + # my ($meta) = $content =~ m{}s; + + if (! $desc) { warn $content; }
die "Could not recognize project page format - has SF changed its layout?\n" unless $desc;
participants (1)
-
Bryce Harrington