wikifacts

Lifecycle: experimental R build status Total Downloads CRAN status Travis build status Codecov test coverage

R package which generates random facts from historic Wikipedia main pages.

Installation

You can install the released version of wikifacts from CRAN with:

install.packages("wikifacts")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("keithmcnulty/wikifacts")

Functionality

Examples

wiki_didyouknow() %>% cat()
#> Did you know that Blackrocks Brewery was created by two unemployed pharmaceutical salesmen? (Courtesy of Wikipedia)
wiki_randomfact() %>% cat()
#> Here's some news from 05 May 2019. An earthquake in Luzon, the Philippines, kills at least 18 people. (Courtesy of Wikipedia)

Use with cowsay:

cowsay::say(wiki_randomfact())
#> 
#>  -------------- 
#> Here's some news from 02 November 2017. In New York City, a ramming attack (vehicle pictured) kills eight people and injures at least eleven others. (Courtesy of Wikipedia) 
#>  --------------
#>     \
#>       \
#>         \
#>             |\___/|
#>           ==) ^Y^ (==
#>             \  ^  /
#>              )=*=(
#>             /     \
#>             |     |
#>            /| | | |\
#>            \| | |_|/\
#>       jgs  //_// ___/
#>                \_)
#> 

Generate multiple random facts:

wiki_randomfact(n_facts = 10, bare_fact = TRUE)
#>  [1] "The wreck of Argentinian submarine San Juan, which disappeared in November 2017, is found in the South Atlantic."                                                                                           
#>  [2] "1842 – American Indian Wars: American general William J. Worth declared the Second Seminole War to be over."                                                                                                
#>  [3] "... that Kavya Manyapu led the development of a dust-repelling fabric for space suits using carbon nanotubes?"                                                                                              
#>  [4] "Cyberattacks on Ukraine spread a new variant of the Petya malware (ransom note pictured) around the world and cause severe disruptions."                                                                    
#>  [5] "... that Green Bay Packers defensive tackle Dave Roller, who weighed 270 pounds (120 kg) at the time, was carried off Lambeau Field by fans after a victory against the Detroit Lions?"                     
#>  [6] "... that Elad Chakrina initially won Mayotte's 1st constituency by 12 votes, lost by 54 votes after a counting error was corrected, then forced a by-election after an appeal?"                             
#>  [7] "... that director and screenwriter Travis Stevens paused renovations on his house to film Girl on the Third Floor?"                                                                                         
#>  [8] "1952 – The Congress of Guatemala passed Decree 900, redistributing unused lands of sizes greater than 224 acres (0.9 km2) to local peasants and having a major effect on the nation's land reform movement."
#>  [9] "... that Prisoners of the Sun—​the fourteenth volume of The Adventures of Tintin—​was made into a musical in 2001?"                                                                                           
#> [10] "... that the 2018 teen drama Skate Kitchen was partly filmed with a camera mounted on a motorized skateboard deck traveling at speeds of up to 20 miles per hour (32 km/h)?"

Search Wikipedia (launches browser with results):

wiki_search('R (programming language)')