Enable students to programatically interact (either httr or rvest?) with my shinyapp

I have created a shiny app for my students. Its great! In its simplest form, they interact with the app using the following generic steps.

  1. Go to URL at foo.shinyapps.io
  2. Enter some information via a text box and radio buttons
  3. Hit a button to get a URL link to some data (which depends on inputs) hosted on dropbox
  4. Manipulate data from the link on their own computers to generate csv for upload
  5. Upload csv to shiny
  6. Receive assignment score via shiny

I was hoping the students might be able to automate the interaction with my shiny app (steps 1,2,3,5,6) using either httr or rvest. After hours of investigation, this does not look as easy as I thought.

Any suggestions or pointers for info about posting-to or scraping interactive shiny apps? Thanks

I have to start with a shameful admission: I'm not a bright shiny object. :grin:

So, fwiw, asking shiny to be the URL-server might not be the most straightforward approach. The simplest would be

git pull origin master

workflow, but the overhead setup is too expensive.

Two alternatives come to mind:

  1. A list bot to provide an URL update for the csv for the current assignment, in the form of a
read.csv(the_url)
# or better readr::read_csv()

to be cut and pasted into the student's R

or

  1. a cgi (do they still call them that?) to do the same thing with access through httr or rvest

If you're looking for computer-to-computer interaction rather than human-to-computer interaction, https://www.rplumber.io might be a better fit.

1 Like

Thanks Hadley for the authoritative guidance.

I was hoping that a simple Shiny site built for human-to-computer interaction would still allow programattic computer-to-computer interaction without modification. In my brain, I conflated web development and API development --- I now see that they are two different animals.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.