I have users calling functions while typing. The problem is that it makes the call for every letter being typed and error is shown if textbox is empty even for 1ms.
Warning: Error in twInterfaceObj$doAPICall: Forbidden (HTTP 403).
How can I change this to make the function call only after about 400ms after the last typed letter?
Here is my Shiny code:
ui.R
shinyUI(fluidPage(
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
textInput("new_hashtag", label = h4("Enter #Hashtag"), value = "#hello")
)
),
mainPanel(
DT::dataTableOutput('mytable1')
)
))
server.R
shinyServer(function(input, output, session) {
output$mytable1 <- DT::renderDataTable({
df <- searchTwitter(as.character(input$new_hashtag)
DT::datatable(twListToDF(df))
})
})