Skip to content

Commit 37bc482

Browse files
author
unknown
committed
init
1 parent 6e37ba0 commit 37bc482

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
easy url proxy on shiny

server.R

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
library(shiny)
2+
library(RCurl)
3+
library(shinyAce)
4+
5+
xmlFunc<-list('xmlGetAttr'=xmlGetAttr, 'xmlValue'=xmlValue)
6+
7+
shinyServer(function(input, output, session) {
8+
9+
urls<-reactive({
10+
unlist(strsplit(input$urls, split='\n'))
11+
})
12+
13+
output$debug<-renderText({
14+
urls
15+
})
16+
17+
output$downloadTable <- downloadHandler(
18+
filename = 'table.txt',
19+
content = function(file) {
20+
dt<-as.data.frame(xpath$data)
21+
fileEncode<-ifelse(input$sameEncodingOnSave, input$encoding, '')
22+
eol<-ifelse(input$isWindows, '\r\n', '\n')
23+
write.table(dt, file, sep='\t', eol=eol, quote=F, row.names=F, fileEncoding=fileEncode)
24+
}
25+
)
26+
27+
})

shinyProxy.Rproj

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX

ui.R

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
library(shiny)
2+
library(shinyAce)
3+
library(DT)
4+
5+
shinyUI(fluidPage(
6+
mainPanel(
7+
aceEditor("urls", mode='html', value="", height="500px"),
8+
textOutput('debug'),
9+
downloadButton('downloadTable', 'Download')
10+
)
11+
))
12+

0 commit comments

Comments
 (0)