Skip to content

Commit 9ac3fb5

Browse files
authored
Add bluesky and mastodon search functions (#45)
* Add bluesky and mastodon * Fix posit forum url * Add to community * 45
1 parent 361dc4f commit 9ac3fb5

15 files changed

+226
-30
lines changed

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export(ask_perplexity)
1616
export(search_bb)
1717
export(search_bing)
1818
export(search_bitbucket)
19+
export(search_bluesky)
1920
export(search_brave)
2021
export(search_ddg)
2122
export(search_duckduckgo)
@@ -25,6 +26,7 @@ export(search_github)
2526
export(search_google)
2627
export(search_grep)
2728
export(search_kagi)
29+
export(search_mastodon)
2830
export(search_posit)
2931
export(search_posit_community)
3032
export(search_qwant)
@@ -35,4 +37,5 @@ export(search_sp)
3537
export(search_stackoverflow)
3638
export(search_startpage)
3739
export(search_twitter)
40+
export(search_x)
3841
export(searcher)

NEWS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
([#42](https://github.com/coatless-rpkg/searcher/pull/42))
2525
- `search_kagi()`: Searches on Kagi.
2626
([#42](https://github.com/coatless-rpkg/searcher/pull/42))
27+
- `search_mastodon()`: Searches on Mastodon.
28+
([#45](https://github.com/coatless-rpkg/searcher/pull/45))
29+
- `search_bluesky()`: Searches on BlueSky.
30+
([#45](https://github.com/coatless-rpkg/searcher/pull/45))
2731
- Added searcher logo ([#40](https://github.com/coatless-rpkg/searcher/pull/40))
2832

2933
## Documentation
@@ -49,7 +53,7 @@
4953

5054
- Deprecated `search_rstudio_community()` and `search_rscom()` functions. ([#43](https://github.com/coatless-rpkg/searcher/pull/43))
5155
- These functions are now replaced by `search_posit_community()`/`search_posit()`
52-
which searches [Posit Community](https://community.posit.co/search).
56+
which searches [Posit Community](https://forum.posit.co/search).
5357

5458
# searcher 0.0.7
5559

R/index-sites.R

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ site_index =
6161
),
6262
site_entry(
6363
"posit community",
64-
"https://community.posit.co/search?q=",
64+
"https://forum.posit.co/search?q=",
6565
"posit",
6666
NULL
6767
),
@@ -81,6 +81,17 @@ site_index =
8181
site_entry(
8282
"twitter",
8383
"https://twitter.com/search?q=",
84+
"x",
85+
keywords = keyword_entry("%23rstats", "%23rstats %23tidyverse") # %23 is #
86+
),
87+
site_entry(
88+
"mastodon",
89+
"https://mastodon.social/search?q=",
90+
keywords = keyword_entry("%23rstats", "%23rstats %23tidyverse") # %23 is #
91+
),
92+
site_entry(
93+
"bluesky",
94+
"https://bsky.app/search?q=",
8495
keywords = keyword_entry("%23rstats", "%23rstats %23tidyverse") # %23 is #
8596
),
8697
site_entry(

R/search-functions.R

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#' `"startpage"` (formerly `"ixquick"`) or `"sp"`,
99
#' `"qwant"`, `"rseek"`, `"brave"`, `"kagi"`,
1010
#' `"posit community"` (formerly `"rstudio community"`) or `"posit"`,
11-
#' `"twitter"`, `"stackoverflow"`,
11+
#' `"twitter"` or `"x"`, `"bluesky"`, `"mastodon"`, `"stackoverflow"`,
1212
#' `"github"`, `"grep"`, `"bitbucket"`,
1313
#' `"chatgpt"`, `"claude"`, `"perplexity"`,
1414
#' `"mistral"`, `"bing copilot"` or `"copilot"`, and
@@ -40,6 +40,9 @@ search_site = function(query,
4040
"posit community",
4141
"posit",
4242
"twitter",
43+
"x",
44+
"bluesky",
45+
"mastodon",
4346
"stackoverflow",
4447
"so",
4548
"github",
@@ -75,7 +78,10 @@ search_site = function(query,
7578
kagi = search_kagi(query, rlang),
7679
`posit community` = , # empty case carried below
7780
posit = search_posit_community(query, rlang),
78-
twitter = search_twitter(query, rlang),
81+
twitter = , # empty case carried below
82+
x = search_twitter(query, rlang),
83+
bluesky = search_bluesky(query, rlang),
84+
mastodon = search_mastodon(query, rlang),
7985
stackoverflow = , # empty case carried below
8086
so = search_stackoverflow(query, rlang),
8187
github = , # empty case carried below
@@ -320,14 +326,14 @@ search_posit_community = searcher("posit")
320326
#' @export
321327
search_posit = search_posit_community
322328

323-
#' Search Twitter
329+
#' Search Twitter/X
324330
#'
325331
#' The `search_twitter()` functions search
326332
#' Twitter using: `https://twitter.com/search?q=<query>`
327333
#'
328334
#' For additional details regarding Twitter's
329335
#' search interface please see:
330-
#' <https://help.twitter.com/en/using-x/x-advanced-search>
336+
#' <https://help.x.com/en/using-x/x-advanced-search>
331337
#'
332338
#' @inheritParams search_site
333339
#' @return The generated search URL or an empty string.
@@ -338,6 +344,39 @@ search_posit = search_posit_community
338344
#' search_twitter("searcher")
339345
search_twitter = searcher("twitter")
340346

347+
#' @rdname search_twitter
348+
#' @export
349+
search_x = search_twitter
350+
351+
#' Search Mastodon
352+
#'
353+
#' The `search_mastodon()` functions search
354+
#' Mastodon using: `https://mastodon.social/search?q=%23rstats+<query>`
355+
#'
356+
#' @inheritParams search_site
357+
#' @return The generated search URL or an empty string.
358+
#' @export
359+
#' @family community sites
360+
#' @examples
361+
#' # Search Mastodon
362+
#' search_mastodon("searcher")
363+
search_mastodon = searcher("mastodon")
364+
365+
366+
#' Search BlueSky
367+
#'
368+
#' The `search_bluesky()` functions search
369+
#' BlueSky using: `https://bsky.app/search?q=%23rstats+<query>`
370+
#'
371+
#' @inheritParams search_site
372+
#' @return The generated search URL or an empty string.
373+
#' @export
374+
#' @family community sites
375+
#' @examples
376+
#' # Search BlueSky
377+
#' search_bluesky("searcher")
378+
search_bluesky = searcher("bluesky")
379+
341380
#' Search StackOverflow
342381
#'
343382
#' The `search_stackoverflow()` and `search_so()` functions both search
@@ -346,7 +385,10 @@ search_twitter = searcher("twitter")
346385
#'
347386
#' For additional details regarding [StackOverflow](https://stackoverflow.com)'s
348387
#' search interface please see:
349-
#' <https://stackoverflow.com/help/searching>
388+
#'
389+
#' ```
390+
#' https://stackoverflow.com/help/searching
391+
#' ```
350392
#'
351393
#' @inheritParams search_site
352394
#' @return The generated search URL or an empty string.

README.Rmd

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ knitr::opts_chunk$set(
1212
)
1313
```
1414

15-
# searcher <img src="man/figures/searcher-animated-logo.svg" width="170" align="right" alt="A hexagonal logo for searcher"/>
15+
# searcher <a href="https://r-pkg.thecoatlessprofessor.com/searcher/" alt="searcher"><img src="man/figures/searcher-animated-logo.svg" width="170" align="right" alt="A hexagonal logo for searcher"/></a>
16+
1617
<!-- badges: start -->
1718
[![R-CMD-check](https://github.com/coatless-rpkg/searcher/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/coatless-rpkg/searcher/actions/workflows/R-CMD-check.yaml)
1819
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/searcher)](https://www.r-pkg.org/pkg/searcher)
1920
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/searcher)](https://cran.r-project.org/package=searcher)
2021
<!-- badges: end -->
2122

23+
## Overview
24+
25+
2226
The goal of `searcher` is to provide a search interface directly inside of _R_.
2327
For example, to look up `rcpp example numeric vector`
2428
or `ggplot2 fix axis labels` call one of the `search_*()` functions to
@@ -65,8 +69,9 @@ major search engines, programming help websites, and code repositories. The foll
6569
platforms are supported: [Google](https://www.google.com), [Bing](https://www.bing.com/),
6670
[DuckDuckGo](https://duckduckgo.com/), [Startpage](https://www.startpage.com/en/),
6771
Ecosia, [rseek](https://rseek.org/), Qwant, [Brave](https://search.brave.com/),
68-
Kagi, X (formerly Twitter), [StackOverflow](https://stackoverflow.com/),
69-
[Posit Community](https://community.posit.co/search),
72+
Kagi, X (formerly Twitter), [BlueSky](https://bsky.app), [Mastodon](https://mastodon.social),
73+
[StackOverflow](https://stackoverflow.com/),
74+
[Posit Community](https://forum.posit.co/),
7075
[GitHub](https://github.com/search), [grep.app](https://grep.app/),
7176
and [BitBucket](https://bitbucket.org/product/).
7277
By default, an appropriate suffix for each platform that ensures relevant
@@ -85,11 +90,19 @@ search_kagi("R project")
8590
search_duckduckgo("R project") # or search_ddg(...)
8691
search_startpage("R project") # or search_sp(...)
8792

88-
# Searching Twitter to find out about machine learning for R and in general
93+
# Searching X/Twitter to find out about machine learning for R and in general
8994
search_twitter("machine learning")
9095
search_twitter("machine learning", rlang = FALSE)
9196

92-
# Searching for linear regression questions for R and in general
97+
# Searching BlueSky to find out about deep learning for R and in general
98+
search_bluesky("deep learning")
99+
search_bluesky("deep learning", rlang = FALSE)
100+
101+
# Searching Mastodon to find out about data visualization for R and in general
102+
search_mastodon("data vis")
103+
search_mastodon("data vis", rlang = FALSE)
104+
105+
# Searching SO for linear regression questions for R and in general
93106
search_stackoverflow("linear regression")
94107
search_stackoverflow("linear regression", rlang = FALSE) # or search_so(...)
95108

@@ -184,8 +197,10 @@ search_rseek()
184197
search_qwant()
185198
search_brave()
186199
search_kagi()
187-
search_twitter()
188200
search_grep()
201+
search_mastodon()
202+
search_bluesky()
203+
search_twitter() # or search_x()
189204
search_duckduckgo() # or search_ddg()
190205
search_startpage() # or search_sp()
191206
search_stackoverflow() # or search_so()

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
<!-- README.md is generated from README.Rmd. Please edit that file -->
33

4-
# searcher <img src="man/figures/searcher-animated-logo.svg" width="170" align="right" alt="A hexagonal logo for searcher"/>
4+
# searcher <a href="https://r-pkg.thecoatlessprofessor.com/searcher/" alt="searcher"><img src="man/figures/searcher-animated-logo.svg" width="170" align="right" alt="A hexagonal logo for searcher"/></a>
55

66
<!-- badges: start -->
77

@@ -11,6 +11,8 @@ downloads](https://cranlogs.r-pkg.org/badges/searcher)](https://www.r-pkg.org/pk
1111
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/searcher)](https://cran.r-project.org/package=searcher)
1212
<!-- badges: end -->
1313

14+
## Overview
15+
1416
The goal of `searcher` is to provide a search interface directly inside
1517
of *R*. For example, to look up `rcpp example numeric vector` or
1618
`ggplot2 fix axis labels` call one of the `search_*()` functions to
@@ -65,8 +67,10 @@ repositories. The following search platforms are supported:
6567
[DuckDuckGo](https://duckduckgo.com/),
6668
[Startpage](https://www.startpage.com/en/), Ecosia,
6769
[rseek](https://rseek.org/), Qwant, [Brave](https://search.brave.com/),
68-
Kagi, X (formerly Twitter), [StackOverflow](https://stackoverflow.com/),
69-
[Posit Community](https://community.posit.co/search),
70+
Kagi, X (formerly Twitter), [BlueSky](https://bsky.app),
71+
[Mastodon](https://mastodon.social),
72+
[StackOverflow](https://stackoverflow.com/), [Posit
73+
Community](https://forum.posit.co/),
7074
[GitHub](https://github.com/search), [grep.app](https://grep.app/), and
7175
[BitBucket](https://bitbucket.org/product/). By default, an appropriate
7276
suffix for each platform that ensures relevant results to *R* is
@@ -85,11 +89,19 @@ search_kagi("R project")
8589
search_duckduckgo("R project") # or search_ddg(...)
8690
search_startpage("R project") # or search_sp(...)
8791

88-
# Searching Twitter to find out about machine learning for R and in general
92+
# Searching X/Twitter to find out about machine learning for R and in general
8993
search_twitter("machine learning")
9094
search_twitter("machine learning", rlang = FALSE)
9195

92-
# Searching for linear regression questions for R and in general
96+
# Searching BlueSky to find out about deep learning for R and in general
97+
search_bluesky("deep learning")
98+
search_bluesky("deep learning", rlang = FALSE)
99+
100+
# Searching Mastodon to find out about data visualization for R and in general
101+
search_mastodon("data vis")
102+
search_mastodon("data vis", rlang = FALSE)
103+
104+
# Searching SO for linear regression questions for R and in general
93105
search_stackoverflow("linear regression")
94106
search_stackoverflow("linear regression", rlang = FALSE) # or search_so(...)
95107

@@ -187,8 +199,10 @@ search_rseek()
187199
search_qwant()
188200
search_brave()
189201
search_kagi()
190-
search_twitter()
191202
search_grep()
203+
search_mastodon()
204+
search_bluesky()
205+
search_twitter() # or search_x()
192206
search_duckduckgo() # or search_ddg()
193207
search_startpage() # or search_sp()
194208
search_stackoverflow() # or search_so()

_pkgdown.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ reference:
8080
- search_posit_community
8181
- search_posit
8282
- search_twitter
83+
- search_bluesky
84+
- search_mastodon
8385

8486
- title: "Code Repositories"
8587
desc: >

man/search_bluesky.Rd

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/search_mastodon.Rd

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/search_posit_community.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)