Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-lwp-gsoc, 2014-07-30

| Channels | #perl6-lwp-gsoc index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
05:59 FROGGS joined #perl6-lwp-gsoc
06:17 sergot hi o/
06:20 sergot I should write tests for IO::Socket::SSL
06:21 sergot And I will use this: https://github.com/perl6/roast/blob/master/S32-io/IO-Socket-INET.t
07:04 sergot Oh, a blogpost first
07:04 sergot :)
08:03 FROGGS joined #perl6-lwp-gsoc
09:55 sergot FROGGS: besides tests, what should I do now?
09:56 sergot I mean, what is the most important now?
09:56 sergot the crawler almost always works
09:59 moritz make that s/always// :-)
09:59 sergot I need some help then :)
10:00 sergot with: 12:56 < moritz> looks like a rakudo/nqp bug with character classes in regexes to me
10:00 sergot http://irclog.perlgeek.de/perl6-lwp-gsoc/2014-07-28#i_9091149
10:01 moritz how does crawler.p6:40 look like?
10:01 sergot 40     $content.match(/ \s 'href="' (<-["]>+) '"' /, :g).map({ $_[0] }).grep({ $_ ~~ m:i/^http/ });
10:02 moritz what's in $content when it complains?
10:02 moritz btw $_ ~~ ... is always redundant
10:02 sergot 16             my $r = $c.get(~$url);
10:02 sergot 27                 $content = $r.content;
10:02 sergot 31                     my @new_url = get-urls($content);
10:02 sergot 39 sub get-urls($content) {
10:02 sergot 40     $content.match(/ \s 'href="' (<-["]>+) '"' /, :g).map({ $_[0] }).grep({ $_ ~~ m:i/^http/ });
10:02 moritz but what's in it when you get the error?
10:03 moritz like, dump it with .perl
10:03 moritz .grep({ $_ ~~ m:i/^http/ });  could be  .grep(/:i ^http/);
10:03 moritz or .grep(rx:i/^http/)
10:06 sergot I cant even do .perl on this
10:08 sergot https://gist.github.com/sergot/5f0b4f139491db35b694
10:10 sergot dont know why it's not the whole page...
10:11 moritz what's the error if you .perl it?
10:11 moritz might be a problem with it not being a properly boxed string
10:11 sergot the same:
10:11 sergot Negative character fed to cclass: '-30' in method perl at src/gen/m-CORE.setting:6257 in sub MAIN at ./crawler.p6:11 in block  at ./crawler.p6:40
10:11 moritz eeks
10:16 sergot weird
10:17 dalek http-useragent: cbb0179 | sergot++ | crawler.p6:
10:17 dalek http-useragent: redundant ~~ removed
10:17 dalek http-useragent: review: https://github.com/sergot/http-useragent/commit/cbb0179e18
10:18 moritz sergot: without the { } please
10:18 moritz grep simply smart-matches each element against the args
10:18 moritz if you pass it { /.../ }, it executes the block, and returns the regex
10:18 moritz which is always true
10:19 moritz so either { m:/.../ } (which runs the regex), or rx/.../ directly
10:19 moritz sergot: I'll try to look into the character class weirdnessa after lunch
10:23 sergot moritz++ great, thanks!
10:24 dalek http-useragent: afc27ce | sergot++ | crawler.p6:
10:24 dalek http-useragent: {} in .grep removed
10:24 dalek http-useragent: review: https://github.com/sergot/http-useragent/commit/afc27ce849
10:49 dalek http-useragent: 090332b | sergot++ | lib/HTTP/Message.pm6:
10:49 dalek http-useragent: .decode-content implemented
10:49 dalek http-useragent: review: https://github.com/sergot/http-useragent/commit/090332b32e
10:49 dalek http-useragent: bf79576 | sergot++ | lib/HTTP/UserAgent.pm6:
10:49 dalek http-useragent: .recv the whole content
10:49 dalek http-useragent:
10:49 dalek http-useragent: even when the reponse doesnt contain Content-Length in the header
10:49 dalek http-useragent: review: https://github.com/sergot/http-useragent/commit/bf79576807
10:50 sergot FROGGS: we dont have to check the content-length
10:50 sergot we can remove the elsif there
10:50 sergot what do you think?
17:02 FROGGS joined #perl6-lwp-gsoc
17:02 FROGGS <sergot> FROGGS: we dont have to check the content-length
17:03 FROGGS we have to, because when you request more bytes than available will it will hang for 0.5 to 1s
17:04 FROGGS sergot: is there an issue you want me to look into right now?

| Channels | #perl6-lwp-gsoc index | Today | | Search | Google Search | Plain-Text | summary