0

I am creating a fantasy football app using R shiny and one of the things I would like to do is have a Twitter list embedded into the homepage with the latest fantasy football news. I have followed the guidance from an earlier post How can I embed a twitter timeline in a Shiny app, and was able to get the timeline up and running a few months ago. Here is a chunk of the relevant code:

    shinyUI(fluidPage(
  navbarPage("Home",
              theme = mycss,
             tabPanel("Home", icon = icon('home'),
                      fluidPage(
                        tags$head(includeScript("www/twittermike.js")),            
                        fluidRow(column(width = 7, img(src = 'home_logo.jpg',
                        width = 200, height = 100, style = "float:left; padding-right:10px"),
                        div(br(),
                        "The Home of The Golden", br(),
                        " - Commisioner Joe"),
                        br(),br(), br(), br(),
                        includeMarkdown("html/overview.Rmd")
                        ),
                        column(width = 5,
                               a(class="twitter-timeline", href="https://twitter.com/POCKETsurACES/lists/fantasy-news", 
                                 src="//platform.twitter.com/widgets.js")))))

Where the twittermike.js file is defined as:

    !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");    

For a reason beyond me, this code is no longer working. I am receiving no errors, but the timeline is not populating. Any help would be greatly appreciated.

  • Not sure if I am supposed to see `https://twitter.com/POCKETsurACES/lists/fantasy-news` working. It is not, at least for me. – Sal Jul 31 '17 at 03:48
  • Have a look at the `iframe` within shiny. https://stackoverflow.com/questions/33020558/embed-iframe-inside-shiny-app/33021018#33021018 – Pork Chop Jul 31 '17 at 07:55

1 Answers1

0

you just need a(class="twitter-timeline", href="https://twitter.com/POCKETsurACES/lists/fantasy-news")

AleRuete
  • 313
  • 3
  • 7