-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.r
65 lines (61 loc) · 1.96 KB
/
app.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
library(shiny)
library(shinyjs)
library(shinyalert)
library(shinythemes)
library(tidyverse)
library(DBI)
library(RMariaDB)
library(DT)
source("download_tweet.r")
#source("quizbot_functions.R")
ui <- fluidPage(
HTML('<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.21/datatables.min.css"/>'),
tags$head(tags$style(".modal-dialog{ width:1000px;}")),
useShinyalert(),HTML('<style>.sweet-alert{width: 878px;
margin-left:-440px;}</style>'),
titlePanel(title=div(h1("Twitter Analytics",style={'background-color: #115EA4;
color: white;
border-radius: 6px;
padding: 0px;
font-family: "Lucida Console", Courier, monospace;
font-weight: bold; font-size: 75px'})
),
),
useShinyjs(),
sidebarLayout(
sidebarPanel(
HTML('<style>
body {
background-image:url("https://i.pinimg.com/736x/b0/de/0c/b0de0c7b2f6df8114a616f7e9b1dfc67.jpg");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
#go{
width: 100%;
}
#button{
float: right;
margin-right: 15px;
}
</style>'),
textInput("hashtag","Hashtag",placeholder = "type the hashtag you want to analyze"),
actionButton(
"go",
"Analyze tweets",
class = "btn-primary"
)
),
mainPanel(
DT::dataTableOutput('input_file_table')
)
),theme = shinytheme("cerulean")
)
server <- function(input, output){
observeEvent(input$go,{
output$input_file_table <- DT::renderDataTable({
input$hashtag %>% analyze_tweet_fun()
})
})
}
shinyApp(ui, server)