====== USPTO ====== [[http://www.google.com/googlebooks/uspto-patents.html]] {{:notes:data:USPTOfiles.txt}} > f <- file("f://data/uspto/files.txt","r") > L <- scan(f,what=character(0),sep=",",n=-1) > S = L[L!=""] > length(S) [1] 870 > head(S) [1] "PatentFullTextAPSDoc_GreenBook.pdf" "ipgb20120103_wk01.zip" [3] "ipgb20120110_wk02.zip" "ipgb20120117_wk03.zip" [5] "ipgb20120124_wk04.zip" "ipgb20120131_wk05.zip" > http://storage.googleapis.com/patents/docs/PatentFullTextAPSDoc_GreenBook.pdf http://storage.googleapis.com/patents/grantbib/2012/ipgb20120103_wk01.zip http://storage.googleapis.com/patents/grantbib/1976/1976.zip % downloading USPTO files % by Vladimir Batagelj, October 2012 cat("Downloading USPTO files\n",date(),"\n\n") setwd("F:/data/uspto") urlA <- "http://storage.googleapis.com/patents/grantbib/" f <- file("f://data/uspto/USPTOfiles.txt","r") L <- scan(f,what=character(0),sep=",",n=-1) close(f); S = L[L!=""] for(d in S){ if(substring(d,1,1)=="*") { s <- paste(urlA,substring(d,2,nchar(d)),'/',sep="") cat("\nDownloading",substring(d,2,nchar(d)),"\n") } else { page <- paste(s,d,sep="") cat(date(),page,'\n') test <- tryCatch(download.file(page,d,method="auto"),error=function(e) e) cat('Test =',test,'\n') } } cat("\nFinished\n",date(),"\n\n")