- Fix the patch to make fetchable with getURL (from RCurl)

to support HTTPS because Yahoo! JAPAN services have been
  migrated to AOSSL
- Update RUN_DEPENDS, accordingly

MFH:	2017Q2
This commit is contained in:
TAKATSU Tomonari 2017-04-01 22:10:03 +00:00
parent cdd9171c1c
commit 36b0e73645
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=437495
3 changed files with 23 additions and 9 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= RFinanceYJ
PORTVERSION= 0.3.1
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= finance
DISTNAME= ${PORTNAME}_${PORTVERSION}
@ -12,7 +12,8 @@ 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

View File

@ -0,0 +1,11 @@
--- DESCRIPTION.orig 2013-12-23 12:54:37 UTC
+++ DESCRIPTION
@@ -8,7 +8,7 @@ Maintainer: Yohei Sato <yohei0511@gmail.
Description: Japanese stock market from Yahoo!-finance-Japan
License: BSD 3-clause License
LazyLoad: yes
-Depends: XML,xts
+Depends: RCurl,XML,xts
Repository: CRAN
Date/Publication: 2013-08-13 09:37:24
Packaged: 2013-08-12 15:06:46 UTC; yokkuns

View File

@ -1,6 +1,6 @@
--- R/quoteStockTsData.R.orig 2013-08-13 00:05:58.000000000 +0900
+++ R/quoteStockTsData.R 2015-01-24 20:34:35.000000000 +0900
@@ -46,42 +46,33 @@
--- R/quoteStockTsData.R.orig 2013-08-12 15:05:58 UTC
+++ R/quoteStockTsData.R
@@ -46,42 +46,34 @@ quoteFXTsData <- function(x, since=NULL,
#get time series data from Yahoo! Finance.
quoteTsData <- function(x,function.financialproduct,since,start.num,date.end,time.interval,type="stock"){
r <- NULL
@ -27,10 +27,12 @@
+ 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 )
@ -54,7 +56,7 @@
}
}
@@ -90,7 +81,6 @@
@@ -90,7 +82,6 @@ quoteTsData <- function(x,function.finan
financial.data <- rbind(financial.data,function.financialproduct(quote.table[[i]]))
}
@ -62,7 +64,7 @@
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)
}