search_api: Search GitHub and build a script index data frame

View source: R/search_api.R

search_apiR Documentation

Search GitHub and build a script index data frame

Description

Use GitHub search API to search for YML files in phuse-scripts repository and output the list.

Usage

search_api(
  file_ext = "yml",
  gh_api = "https://api.github.com/search/code",
  rp_name = "phuse-org/phuse-scripts",
  rep_url = "https://github.com/phuse-org/phuse-scripts",
  rep_dir = "tree/master",
  rep_base = "https://raw.githubusercontent.com/phuse-org/phuse-scripts/master",
  loc_base = "C:/myCodes/phuse-org/phuse-scripts",
  filename = NULL,
  search_for = NULL,
  size = NULL,
  path = NULL
)

Arguments

file_ext

file extension; default to 'yml'

gh_api

GitHub API URL; default to 'https://api.github.com/search/code'

rp_name

repository name; default to 'phuse-org/phuse-scripts'

rep_url

a URL for a remote repository and default to 'https://github.com/phuse-org/phuse-scripts'

rep_dir

rep dir for file name; default to 'tree/master'

rep_base

a URL for repository base folder; default to "https://github.com/phuse-org/phuse-scripts/raw/master"

loc_base

a URL for repository base folder; default to "C:/myCodes/phuse-org/phuse-scripts"

filename

file names to be searched; default to null

search_for

text or key word to be searched in the files; defualt to null.

size

file size; default to null

path

file path; default to null

Value

a list of YML files

Author(s)

Hanming Tu

Examples

## Not run: 
  r1 <- search_api('yml')

## End(Not run)

TuCai/phuse documentation built on Sept. 2, 2022, 5:17 a.m.