Advertisement
Guest User

Untitled

a guest
Sep 18th, 2015
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 2.00 KB | None | 0 0
  1. for $hash.kv -> $key, $val {
  2.   if ($key ~~ /^\d+$/) {
  3.     sleep(1);
  4.     my $surl = "$fimbaseurl" ~ "api/story.php?story=$key";
  5.     say "Getting info for story $key - $surl";
  6.     my $time = time;
  7.     my $p = qqx{wget -o /dev/null -O - $surl};
  8.     my $timewget = time - $time;
  9.     $time = time;
  10.     my $rep = $ua.get($surl);
  11.     my $timeua = time - $time;
  12.     $time = time;
  13.     $p = LWP::Simple.get($surl);
  14.     my $timelwp = time - $time;
  15.     say "Request took (wget, ua, lwp) : $timewget ; $timeua ; $timelwp (" ~ $p.defined ~ ")";
  16.     #my Story $story = fromJSON($rep.content);
  17.     #$story.character_tags = @($val);
  18.     #$bookshelf.stories.push($story);
  19.   }
  20. }
  21.  
  22.  
  23. Getting info for story 278045 - http://www.fimfiction.net/api/story.php?story=278045
  24. Request took (wget, ua, lwp) : 1 ; 47 ; 0 (False)
  25. Getting info for story 275680 - http://www.fimfiction.net/api/story.php?story=275680
  26. Request took (wget, ua, lwp) : 0 ; 1 ; 1 (False)
  27. Getting info for story 262566 - http://www.fimfiction.net/api/story.php?story=262566
  28. Request took (wget, ua, lwp) : 0 ; 1 ; 0 (False)
  29. Getting info for story 253961 - http://www.fimfiction.net/api/story.php?story=253961
  30. Request took (wget, ua, lwp) : 1 ; 46 ; 0 (False)
  31. Getting info for story 287787 - http://www.fimfiction.net/api/story.php?story=287787
  32. Request took (wget, ua, lwp) : 5 ; 47 ; 0 (False)
  33. Getting info for story 230097 - http://www.fimfiction.net/api/story.php?story=230097
  34. Request took (wget, ua, lwp) : 0 ; 2 ; 0 (False)
  35. Getting info for story 288143 - http://www.fimfiction.net/api/story.php?story=288143
  36. Request took (wget, ua, lwp) : 1 ; 46 ; 0 (False)
  37. Getting info for story 272763 - http://www.fimfiction.net/api/story.php?story=272763
  38. Request took (wget, ua, lwp) : 1 ; 46 ; 1 (False)
  39. Getting info for story 275886 - http://www.fimfiction.net/api/story.php?story=275886
  40. Request took (wget, ua, lwp) : 0 ; 47 ; 0 (False)
  41. Getting info for story 284498 - http://www.fimfiction.net/api/story.php?story=284498
  42. Request took (wget, ua, lwp) : 0 ; 47 ; 0 (False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement