This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# imports the necessary libraries | |
library(scriptuRs, stringr) | |
# creates a function to import Bible data, select important columns, detect the first string passed to the function, and create a new column in which that string is replaced by the second string passed to the function. Function returns a dataframe of each verse that includes the first string. The `revText` column contains the revised text of each verse. | |
bibleEdit <- function(kjv, nkjv){ | |
bible <- kjv_bible() %>% | |
select(chapter_number, verse_number, verse_title, book_title, text) %>% | |
drop_na(text) %>% | |
filter(grepl(kjv, text, ignore.case = T)) %>% | |
# filter(str_detect(text, kjv)) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script builds on Aleszu Bajak's excellent | |
# [tutorial on building a course website using R Markdown and Github pages](http://www.storybench.org/convert-google-doc-rmarkdown-publish-github-pages/). | |
# I was excited about the concept but wanted to automate a few of the production steps: namely generating the HTML files | |
# for the site from the RMD pages (which Aleszu describes doing one-by-one) and generating the site navigation menu, | |
# which Aleszu handcodes in the `_site.yml` file. This script should automate both processes, though it may have some quirks | |
# unique to my setup that you'd want to tweak to fit your own. It's likely more loquacious than necessary as well, so feel free | |
# to condense as you can. Ideally, each time you make updates to your RMD files you can run this script to generate updated HTML | |
# pages and a new `_site.yml`. Then commit changes to Github and you're up and running! | |
# Once you've got everything configured for your own site below, you should be able to run `source('rend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Programming Literary Bots" | |
author: "Ryan Cordell" | |
date: "3/12/2017" | |
output: html_document | |
--- | |
## Acknowledgements | |
This version of my twitterbot assignment was adapted from [an original written in Python](https://www.dropbox.com/s/r1py3zazde2turk/Trendingmore.py?dl=0), which itself adapted code written by Mark Sample. That orginal bot tweeted (I've since stopped it) at [Quoth the Ravbot](https://twitter.com/Quoth__the). The current version owes much to advice and code borrowed from two colleagues at Northeastern University: Jonathan Fitzgerald and Benjamin Schmidt. |