search_site: Search a Query on a Search Portal in a Web Browser

View source: R/search-functions.R

search_siteR Documentation

Search a Query on a Search Portal in a Web Browser

Description

Creates an appropriate query string for a search engine and then opens up the resulting page in a web browser.

Usage

search_site(
  query,
  site = c("google", "bing", "duckduckgo", "ddg", "startpage", "sp", "qwant", "rseek",
    "rstudio community", "rscom", "twitter", "stackoverflow", "so", "github", "gh",
    "grep", "bitbucket", "bb"),
  rlang = TRUE
)

search_google(query = geterrmessage(), rlang = TRUE)

search_bing(query = geterrmessage(), rlang = TRUE)

search_duckduckgo(query = geterrmessage(), rlang = TRUE)

search_ddg(query = geterrmessage(), rlang = TRUE)

search_ixquick(query = geterrmessage(), rlang = TRUE)

search_startpage(query = geterrmessage(), rlang = TRUE)

search_sp(query = geterrmessage(), rlang = TRUE)

search_ecosia(query = geterrmessage(), rlang = TRUE)

search_rseek(query = geterrmessage(), rlang = TRUE)

search_qwant(query = geterrmessage(), rlang = TRUE)

search_rstudio_community(query = geterrmessage(), rlang = TRUE)

search_rscom(query = geterrmessage(), rlang = TRUE)

search_twitter(query = geterrmessage(), rlang = TRUE)

search_stackoverflow(query = geterrmessage(), rlang = TRUE)

search_so(query = geterrmessage(), rlang = TRUE)

search_github(query = geterrmessage(), rlang = TRUE)

search_gh(query = geterrmessage(), rlang = TRUE)

search_grep(query = geterrmessage(), rlang = TRUE)

search_bitbucket(query = geterrmessage(), rlang = TRUE)

search_bb(query = geterrmessage(), rlang = TRUE)

Arguments

query

Contents of string to search. Default is the error message.

site

Name of site to search on. Supported options: "google" (default), "bing", "duckduckgo", "startpage", "qwant","rstudio community", "twitter","stackoverflow", "github", "grep", and "bitbucket".

rlang

Search for results written in R. Default is TRUE

Value

The generated search URL or an empty string.

Google Search

The search_google function searches Google using: ⁠https://www.google.com/search?q=<query>⁠

See https://moz.com/learn/seo/search-operators for details.

Bing Search

The search_bing() function searches Bing using: ⁠https://www.bing.com/search?q=<query>⁠

DuckDuckGo Search

The search_duckduckgo() and search_ddg() functions both search DuckDuckGo using: ⁠https://duckduckgo.com/?q=<query>⁠

Startpage Search

The search_startpage() function searches startpage using: https://startpage.com/do/dsearch?query=<query>

Ecosia Search

The search_ecosia() function searches Ecosia using: https://www.ecosia.org/search?q=<query>

For additional details regarding Ecosia's search interface please see: https://ecosia.helpscoutdocs.com/article/502-ecosia-on-desktop

Rseek Search

The search_rseek() function searches Rseek using: ⁠https://rseek.org/?q=<query>⁠

Qwant Search

The search_qwant() function searches Qwant using: ⁠https://www.qwant.com/?q=<query>⁠

RStudio Community Search

The search_rstudio_community() and search_rscom() functions both search RStudio Community using: https://community.rstudio.com/search?q=<query>

For additional details regarding RStudio Community's search interface please see the Discourse API documentation: https://docs.discourse.org/#tag/Search

Twitter Search

The search_twitter() functions search Twitter using: https://twitter.com/search?q=<query>

For additional details regarding Twitter's search interface please see: ⁠https://help.twitter.com/en/using-x/x-advanced-search⁠

StackOverflow Search

The search_stackoverflow() and search_so() functions both search StackOverflow using: https://stackoverflow.com/search?q=%5Br%5D+<query>

For additional details regarding StackOverflow's search interface please see: ⁠https://stackoverflow.com/help/searching⁠

GitHub Search

The search_github() and search_gh() functions both search GitHub using: https://github.com/search?q=<query>+language%3Ar+type%3Aissue&type=Issues

For additional details regarding GitHub's search interface please see: https://docs.github.com/en/enterprise-cloud@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github and https://docs.github.com/en/search-github/searching-on-github/searching-code/

grep.app Search

The search_grep() function searches all public code on GitHub using grep.app by querying: ⁠https://grep.app/search?q=<query-here>&filter[lang][0]=R⁠

BitBucket Search

The search_bitbucket() and search_bb() functions both search BitBucket using: https://bitbucket.org/search?q=lang%3Ar+<query>

For additional details regarding BitBucket's search interface please see: https://confluence.atlassian.com/bitbucket/code-search-in-bitbucket-873876782.html

See Also

search_google(), search_bing(), search_duckduckgo(), search_startpage(), search_rseek(), search_qwant(), search_twitter(), search_rstudio_community(), search_stackoverflow(), search_github(), search_grep(), search_bitbucket(), and searcher()

Examples

# Search in a generic way
search_site("r-project", "google")

# Search Google
search_google("r-project")

# Search Bing
search_bing("Microsoft R")

# Search DuckDuckGo
search_duckduckgo("R language")

# Search startpage
search_startpage("VS Code")

# Search Rseek
search_rseek("searcher")

# Search Qwant
search_qwant("Quarto")

# Search RStudio Community
search_rstudio_community("RStudio IDE")

# Search Twitter
search_twitter("searcher")

# Search StackOverflow for Convolutions in the r tag
search_stackoverflow("convolutions")

# Search all languages on StackOverflow for convolutions
search_stackoverflow("convolutions", rlang = FALSE)

# Search GitHub Issues for bivariate normal in the language:r
search_github("bivariate normal")

# Search all languages on GitHub Issues for bivariate normal
search_github("bivariate normal", rlang = FALSE)

# Search R code on GitHub for numerical optimization
search_grep("optim")

# Search all code on GitHub for numerical optimization
search_grep("optim", rlang = FALSE)

# Search BitBucket for assertions
search_bitbucket("assertions")

## Not run: 
# On error, automatically search the message on google
options(error = searcher("google"))
options(error = search_google)

## End(Not run)

searcher documentation built on May 29, 2024, 8:59 a.m.