internal-projects/21_xmlview-package.md

Using xmlview package

This is more for interactive use.

library(googlesheets)
library(xml2)
library(xmlview)

if (!interactive()) {
  gs_auth(file.path("..", "tests", "testthat", "googlesheets_token.rds"))
}
## Auto-refreshing stale OAuth token.
key <- "1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ"
ss <- gs_key(key)
## Authorization will be used.
## Sheet successfully identified: "12"
ws <- 1
gs_read(ss)
## Accessing worksheet titled "Sheet1"
## No encoding supplied: defaulting to UTF-8.
## Source: local data frame [2 x 1]
## 
##     foo
##   (chr)
## 1 hello
## 2 world
this_ws <- googlesheets:::gs_ws(ss, ws, verbose = FALSE)
req <- httr::GET(this_ws$listfeed, googlesheets:::get_google_token())
rc <- googlesheets:::content_as_xml_UTF8(req)
xml_view(rc)
{"x":{"xmlDoc":"\nhttp://www.w3.org/2005/Atom\" xmlns:openSearch=\"http://a9.com/-/spec/opensearchrss/1.0/\" xmlns:gsx=\"http://schemas.google.com/spreadsheets/2006/extended\">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full\u003c/id>2016-02-20T04:25:10.497Z\u003c/updated>http://schemas.google.com/spreadsheets/2006\" term=\"http://schemas.google.com/spreadsheets/2006#list\"/>Sheet1\u003c/title><link rel=\"alternate\" type=\"application/atom+xml\" href=\"<a href="https://docs.google.com/spreadsheets/d/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/edit">https://docs.google.com/spreadsheets/d/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/edit</a>\"/><link rel=\"<a href="http://schemas.google.com/g/2005#feed">http://schemas.google.com/g/2005#feed</a>\" type=\"application/atom+xml\" href=\"<a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full</a>\"/><link rel=\"<a href="http://schemas.google.com/g/2005#post">http://schemas.google.com/g/2005#post</a>\" type=\"application/atom+xml\" href=\"<a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full</a>\"/><link rel=\"self\" type=\"application/atom+xml\" href=\"<a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full</a>\"/><author><name>gspreadr\u003c/name><email>gspreadr@gmail.com\u003c/email>\u003c/author><openSearch:totalResults>2\u003c/openSearch:totalResults><openSearch:startIndex>1\u003c/openSearch:startIndex><entry><id><a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cokwr">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cokwr</a>\u003c/id><updated>2016-02-20T04:25:10.497Z\u003c/updated><category scheme=\"<a href="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006</a>\" term=\"<a href="http://schemas.google.com/spreadsheets/2006#list">http://schemas.google.com/spreadsheets/2006#list</a>\"/><title type=\"text\">hello\u003c/title><content type=\"text\"/><link rel=\"self\" type=\"application/atom+xml\" href=\"<a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cokwr">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cokwr</a>\"/><link rel=\"edit\" type=\"application/atom+xml\" href=\"<a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cokwr/p0pjca">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cokwr/p0pjca</a>\"/><gsx:foo>hello\u003c/gsx:foo>\u003c/entry><entry><id><a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cpzh4">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cpzh4</a>\u003c/id><updated>2016-02-20T04:25:10.497Z\u003c/updated><category scheme=\"<a href="http://schemas.google.com/spreadsheets/2006">http://schemas.google.com/spreadsheets/2006</a>\" term=\"<a href="http://schemas.google.com/spreadsheets/2006#list">http://schemas.google.com/spreadsheets/2006#list</a>\"/><title type=\"text\">world\u003c/title><content type=\"text\"/><link rel=\"self\" type=\"application/atom+xml\" href=\"<a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cpzh4">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cpzh4</a>\"/><link rel=\"edit\" type=\"application/atom+xml\" href=\"<a href="https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cpzh4/12fo22a">https://spreadsheets.google.com/feeds/list/1oLRq_aSy5A6uh60-Hk3EZ3bcu-rGJBx_H7VuXRxn2FQ/od6/private/full/cpzh4/12fo22a</a>\"/><gsx:foo>world\u003c/gsx:foo>\u003c/entry>\u003c/feed>\n","styleSheet":"default","addFilter":false,"applyXPath":null,"scroll":false,"xmlDocName":"rc"},"evals":[],"jsHooks":[]} <br /> <br /> <div class='only-mobile' style='width: 320px; height: 100px; text-align: center;'><!-- rdrr-mobile-responsive --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6535703173049909" data-ad-slot="4915028187" data-ad-format="auto"></ins></div> <small><a href="/github/jennybc/googlesheets/">jennybc/googlesheets documentation</a> built on Feb. 8, 2022, 11:48 p.m.</small> </div> <div class="ui inverted darkblue vertical footer segment" style='margin-top: 16px; padding: 32px;'> <div class="ui center aligned container"> <div class="ui stackable inverted divided three column centered grid"> <div class="five wide column"> <h4 class="ui inverted header">R Package Documentation</h4> <div class='ui inverted link list'> <a class='item' href='/'>rdrr.io home</a> <a class='item' href='/r/'>R language documentation</a> <a class='item' href='/snippets/'>Run R code online</a> </div> </div> <div class="five wide column"> <h4 class="ui inverted header">Browse R Packages</h4> <div class='ui inverted link list'> <a class='item' href='/all/cran/'>CRAN packages</a> <a class='item' href='/all/bioc/'>Bioconductor packages</a> <a class='item' href='/all/rforge/'>R-Forge packages</a> <a class='item' href='/all/github/'>GitHub packages</a> </div> </div> <div class="five wide column"> <h4 class="ui inverted header">We want your feedback!</h4> <small>Note that we can't provide technical support on individual packages. You should contact the package authors for that.</small> <div class='ui inverted link list'> <a class='item' href="https://twitter.com/intent/tweet?screen_name=rdrrHQ"> <div class='ui large icon label twitter-button-colour'> <i class='whiteish twitter icon'></i> Tweet to @rdrrHQ </div> </a> <a class='item' href="https://github.com/rdrr-io/rdrr-issues/issues"> <div class='ui large icon label github-button-colour'> <i class='whiteish github icon'></i> GitHub issue tracker </div> </a> <a class='item' href="mailto:ian@mutexlabs.com"> <div class='ui teal large icon label'> <i class='whiteish mail outline icon'></i> ian@mutexlabs.com </div> </a> <a class='item' href="https://ianhowson.com"> <div class='ui inverted large image label'> <img class='ui avatar image' src='/static/images/ianhowson32.png'> <span class='whiteish'>Personal blog</span> </div> </a> </div> </div> </div> </div> <br /> <div class='only-mobile' style='min-height: 120px'>   </div> </div> </div> <!-- suggestions button --> <div style='position: fixed; bottom: 2%; right: 2%; z-index: 1000;'> <div class="ui raised segment surveyPopup" style='display:none'> <div class="ui large header">What can we improve?</div> <div class='content'> <div class="ui form"> <div class="field"> <button class='ui fluid button surveyReasonButton'>The page or its content looks wrong</button> </div> <div class="field"> <button class='ui fluid button surveyReasonButton'>I can't find what I'm looking for</button> </div> <div class="field"> <button class='ui fluid button surveyReasonButton'>I have a suggestion</button> </div> <div class="field"> <button class='ui fluid button surveyReasonButton'>Other</button> </div> <div class="field"> <label>Extra info (optional)</label> <textarea class='surveyText' rows='3' placeholder="Please enter more detail, if you like. Leave your email address if you'd like us to get in contact with you."></textarea> </div> <div class='ui error message surveyError' style='display: none'></div> <button class='ui large fluid green disabled button surveySubmitButton'>Submit</button> </div> </div> </div> <button class='ui blue labeled icon button surveyButton only-desktop' style='display: none; float: right;'><i class="comment icon"></i> Improve this page</button> </div> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <div class="ui modal snippetsModal"> <div class="header"> Embedding an R snippet on your website </div> <div class="content"> <div class="description"> <p>Add the following code to your website.</p> <p> <textarea class='codearea snippetEmbedCode' rows='5' style="font-family: Consolas,Monaco,'Andale Mono',monospace;">REMOVE THIS</textarea> <button class='ui blue button copyButton' data-clipboard-target='.snippetEmbedCode'>Copy to clipboard</button> </p> <p>For more information on customizing the embed code, read <a href='/snippets/embedding/'>Embedding Snippets</a>.</p> </div> </div> <div class="actions"> <div class="ui button">Close</div> </div> </div> <script type="text/javascript" src="/static/CACHE/js/73d0b6f91493.js"></script> <script type="text/javascript" src="/static/CACHE/js/484b2a9a799d.js"></script> <script type="text/javascript" src="/static/CACHE/js/4f8010c72628.js"></script> <script type="text/javascript">$(document).ready(function(){$('.snip-run').click(runClicked);var key='ctrl+enter';var txt=' (Ctrl-Enter)';if(navigator&&navigator.platform&&navigator.platform.startsWith&&navigator.platform.startsWith('Mac')){key='command+enter';txt=' (Cmd-Enter)';} $('.snip-run').text('Run '+txt);Mousetrap.bind(key,function(e){if($('.snip-run').hasClass('disabled')){return;} var faketarget=$('.snip-run')[0] runClicked({currentTarget:faketarget});});});</script> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic,800,800italic"> <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Oswald:400,300,700"> </body> </html>