id: quick-start title: Quick Start sidebar_label: Quick Start
If you are familiar with R and rtweet run the snippet below from a newly created directory or RStudio project and jump to Configure section. Otherwise follow along this document.
install.packages("remotes", repos = "https://cran.rstudio.com")
remotes::install_github("JohnCoene/chirp") # install
chirp::build_nest() # create config file
chirp::check_nest() # check config file
chirp::chirp() # launch
Note that the app may not launch dependeing on whether you have used rtweet in the past, if it does not go to the Configure section to understand why.
Chirp is written in R, the programming language must thus be installed on your machine. Once installed follow the instructions below to setup a working Chirp platform on your local machine.
First, create an empty directory where to host Chirp.
mkdir chirp
cd ./chirp
Chirp is hosted on Github and can be installed using the remotes
package.
install.packages("remotes", repos = "https://cran.rstudio.com")
remotes::install_github('JohnCoene/chirp')
R -e "install.packages('remotes', repos = 'https://cran.rstudio.com');\remotes::install_github('JohnCoene/chirp')"
Now we can initialise Chirp. Make sure you are running this from the root of the directory where you want the application hosted. The command below will create a default configuration file called _chirp.yml
and open it in your terminal or RStudio IDE.
chirp::build_nest()
R -e "chirp::build_nest()"
The configuration file (_chirp.yml
) allows you to customise Chirp and hold Twitter credentials.
Chirp comes integrated with the Twitter Search API, and therefore needs to be able to access or create a Twitter token (using rtweet).
The credentials are somewhat particular, either:
rtweet
package in which case Chirp will use your internally saved credentials: you can thus jump straight to the Check section.rtweet
on your machine; simply follow along to get setup.There is probably a third possibility, the above confuses you as you are not familiar with R or rtweet
in which case keep reading.
You can obtain the keys and tokens mentioned in _chirp.yml
under credentials
by heading to apps.twitter.com and creating an application. Fill in the form however you see fit, the only thing of importance is to fill in the "Callback URLs" with http://127.0.0.1:1410
.
With that done head to the "Keys and tokens" tab where you should find the information required in _chirp.yml
:
credentials:
consumer_key: xXxxXXxxxxXXxxX
consumer_secret: xXxxXXxxxxXXxxX
access_token: xXxxXXxxxxXXxxX
access_secret: xXxxXXxxxxXXxxX
Before we launch Chirp we can make sure that Chirp can run. The function below will print helpful messages to the console if issues are found.
chirp::check_nest()
R -e "chirp::check_nest()"
You can now run Chirp.
chirp::chirp()
R -e "chirp::chirp()"
The above will open your browser and you'll be ready to use Chirp.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.