Advertisement
Guest User

Untitled

a guest
Sep 4th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. use WWW;
  2. use DOM::Tiny;
  3. use Text::CSV;
  4. use URI::Encode;
  5.  
  6. constant OUT_FILE = 'results2.txt'.IO;
  7.  
  8. my $term = uri_encode "Babesiosis";
  9. my $year = 2001;
  10. #"temp".IO.spurt: get "https://patents.google.com/xhr/query?url=q%3D$term%26country%3DUS%26before%3D20010101%26after%3D20011231&exp=&download=true";
  11. "temp".IO.spurt: get "https://patents.google.com/?q=Babesiosis&country=US&before=20011231&after=20010101;
  12. my $results-num = csv(:in<temp>).elems - 2;
  13. say $results-num;
  14. OUT_FILE.spurt: :append, "$term,$year,$results-num\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement