Index: head/finance/R-cran-RFinanceYJ/Makefile =================================================================== --- head/finance/R-cran-RFinanceYJ/Makefile (revision 437494) +++ head/finance/R-cran-RFinanceYJ/Makefile (revision 437495) @@ -1,20 +1,21 @@ # Created by: TAKATSU Tomonari # $FreeBSD$ PORTNAME= RFinanceYJ PORTVERSION= 0.3.1 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= finance DISTNAME= ${PORTNAME}_${PORTVERSION} MAINTAINER= tota@FreeBSD.org COMMENT= Japanese stock market from Yahoo!-finance-Japan LICENSE= BSD3CLAUSE -RUN_DEPENDS= R-cran-XML>0:textproc/R-cran-XML \ +RUN_DEPENDS= R-cran-RCurl>0:ftp/R-cran-RCurl \ + R-cran-XML>0:textproc/R-cran-XML \ R-cran-xts>0:math/R-cran-xts USES= cran:auto-plist .include Index: head/finance/R-cran-RFinanceYJ/files/patch-DESCRIPTION =================================================================== --- head/finance/R-cran-RFinanceYJ/files/patch-DESCRIPTION (nonexistent) +++ head/finance/R-cran-RFinanceYJ/files/patch-DESCRIPTION (revision 437495) @@ -0,0 +1,11 @@ +--- DESCRIPTION.orig 2013-12-23 12:54:37 UTC ++++ DESCRIPTION +@@ -8,7 +8,7 @@ Maintainer: Yohei Sato = 51 ){ + while( 1 ){ start.num <- start.num + 1 quote.table <- NULL - quote.url <- paste('http://info.finance.yahoo.co.jp/history/?code=',x,start,end,'&p=',start.num,'&tm=',substr(time.interval,1,1),sep="") +- quote.url <- paste('http://info.finance.yahoo.co.jp/history/?code=',x,start,end,'&p=',start.num,'&tm=',substr(time.interval,1,1),sep="") ++ quote.url <- paste('https://info.finance.yahoo.co.jp/history/?code=',x,start,end,'&p=',start.num,'&tm=',substr(time.interval,1,1),sep="") ++ quote.html <- getURL(quote.url) - try( r <- xmlRoot(htmlTreeParse(quote.url,error=xmlErrorCumulator(immediate=F))), TRUE) -+ try( r <- htmlParse(quote.url) ) ++ try( r <- htmlParse(quote.html) ) if( is.null(r) ) stop(paste("Can not access :", quote.url)) - #try( quote.table <- r[[2]][[1]][[1]][[16]][[1]][[1]][[1]][[4]][[1]][[1]][[1]], TRUE ) - try( quote.table <- extractQuoteTable(r,type), TRUE ) + try( quote.table <- xpathApply(r,"//table")[[2]], TRUE ) + + quote.size <- xmlSize(quote.table) + + if( xmlSize(quote.table) <= 1 ){ + return(financial.data) + } if( is.null(quote.table) ){ if( is.null(financial.data) ){ stop(paste("Can not quote :", x)) }else{ - financial.data <- financial.data[order(financial.data$date),] - return(financial.data) + financial.data <- financial.data[order(financial.data$date),] + return(financial.data) } } -@@ -90,7 +81,6 @@ +@@ -90,7 +82,6 @@ quoteTsData <- function(x,function.finan financial.data <- rbind(financial.data,function.financialproduct(quote.table[[i]])) } - result.num <- xmlSize(quote.table) Sys.sleep(1) } financial.data <- financial.data[order(financial.data$date),] -@@ -120,5 +110,3 @@ +@@ -120,5 +111,3 @@ endOfMonth <- function(date.obj) return(startOfNextMonth-1) } - -