Html 如何在闪亮的应用程序中嵌入twitter时间线?
难以将twitter时间线嵌入闪亮的应用程序 试图遵循此代码Html 如何在闪亮的应用程序中嵌入twitter时间线?,html,r,twitter,shiny,shinydashboard,Html,R,Twitter,Shiny,Shinydashboard,难以将twitter时间线嵌入闪亮的应用程序 试图遵循此代码 library(shiny) runApp(list(ui = fluidPage( tags$head(tags$script('!function(d,s,id){var js,fjs=d.getElementsByTagName(s) [0],p=/^http:/.test(d.location)?\'http\':\'https\';if(!d.getElementById(id)){js=d.createEleme
library(shiny)
runApp(list(ui = fluidPage(
tags$head(tags$script('!function(d,s,id){var js,fjs=d.getElementsByTagName(s) [0],p=/^http:/.test(d.location)?\'http\':\'https\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");')),
titlePanel(""),
sidebarLayout(
sidebarPanel()
, mainPanel(
a("Soccer", class="twitter-timeline"
, href = "https://twitter.com/pssGuy/timelines/524678699061641216"
, "data-widget-id" = "524686407298596864")
)
)
)
, server = function(input, output, session){
}
)
)
但是现在twitter已经改变了他们制作小部件的方式,我不知道如何获得新的数据小部件id。我不太熟悉HTML或JS,所以如果有任何帮助,我将不胜感激
希望将“的时间线嵌入到编辑中,以包含关于重新格式化的OP注释,并将其作为带有选项卡的闪亮仪表板页面。 我认为您不再需要
数据小部件id
。这为我加载了时间线
library(shiny)
runApp(list(ui = dashboardPage(header=dashboardHeader(titleWidth=150,
title = "Title"),
sidebar=dashboardSidebar(width=150,
sidebarMenu(
menuItem("Twitter Timeline", tabName="twittertimeline", icon=icon("globe")),
menuItem("Empty Tab", tabName = "empty", icon=icon("info-circle"))
)
),
body=dashboardBody(
tabItems(
tabItem(tabName="twittertimeline",
fluidRow(column(width=12,
tags$head(tags$script('!function(d,s,id){var js,fjs=d.getElementsByTagName(s) [0],p=/^http:/.test(d.location)?\'http\':\'https\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");')),
column(width=6, box(width=NULL, height=NULL,
a("Tweets by @CityOfBoston", class="twitter-timeline"
, href = "https://twitter.com/CityOfBoston"
)
)
)
))),
tabItem(tabName="empty",
fluidRow(column(width=12,
box(width=NULL,height=NULL)
)))
)))
, server = function(input, output, session){
}
)
)
问题,这是单独工作的,但在使用dashboardPage()而不是fluidPage()时,我无法让它在闪亮的仪表板选项卡中工作,我在tagAssert(header,type=“header”,class=“main header”)中遇到错误:标签类型应为Header。应更新上述代码,以反映重新格式化到闪亮的仪表板页面中。