This function takes a value and field to search, then runs GET functions against the site to return metadata on any matched entries

find_content(value_to_match, field_to_match = c("id", "url", "title"),
  use_regex_matching = FALSE, parent_page_id = NULL,
  content_category = "", site_domain = getOption("googlesites.site_domain"),
  site_name = getOption("googlesites.site_name"), verbose = FALSE)

Arguments

value_to_match

A string that should match an entry on the target google site

field_to_match

A string indicating which field of the entry the match should be compared against.

use_regex_matching

A logical indicating whether to take the value_to_match and use it to matched as-is similar to the fixed argument in grep.

parent_page_id

A string representing the entry id of a webpage where the content should be located. This value is typically formatted like: https://sites.google.com/feeds/content/domainName/siteName/PARENT_ENTRY_ID. Leave the value NULL to not restrict results at all or leave blank to specify entries at the top-level of the site.

content_category

A string or a collection of strings that specify which types of entries to search against. If none are provided then all entries are scanned. This argument acts as a filter to speed up the search process. Accepted values are announcement, announcementspage, attachment, comment, filecabinet, listitem, listpage, webpage, webattachment, template

site_domain

A string representing 'site' or the domain of your Google Apps hosted domain (e.g. example.com)

site_name

A string representing the webspace name of your site; found in the Site's URL (e.g. myCoolSite)

verbose

A logical indicating whether to print messages

Source

utils.R

Value

A list of length two consisting of a URL for the created attachment and the Google Sites Entry ID

Examples

# NOT RUN {
# find a page entitled My Report
page_id <- find_content(value_to_match='My Report',
                        field_to_match='title',
                        content_category='webpage')

# find all templates                     
page_id <- find_content(value_to_match='*',
                        field_to_match='title',
                        use_regex_matching=TRUE,
                        content_category='template')
# }