Skip to content

About

Like a talking fortune cookie, Cheerful Fortune tells you a nerdy quote or interesting fact.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Repository files navigation

Cheerful Fortune

Cheerful Fortune looks to recreate some of the functionality of BSD Fortune in a single page web app and add new stuff like text-to-speech functionality.

We use Jekyll to manage the site, Bootstrap to make things pretty and jQuery to load the fortune files and randomly select a good one.

The fortune files were pulled from the original BSD Fortune and many other sources cited below.

  • Jekyll
  • Bootstrap
  • jQuery
  • JavaScript SpeechSynthesisUtterance API

Fortune sources

Adding a new Fortune source

Make sure to add the new fortune source to the /fortunes directory noting where you got it. After you add the files you will need to update the rakefile.rb and add the new fortune files and then run rake. Running the rakefile will generate a new JavaScript Hash object that will list all the fortune files and how many fortunes are in it. This is so JavaScript can properly randomize between fortunes without loading each file. This optimization was made to save to save bandwidth on each page load.

Text to Speech

Cheerful Fortune uses the brand new Text to Speech JavaScript API that's now quite common among modern browsers. We use the stock browser implementation documented well below.

https://developers.google.com/web/updates/2014/01/Web-apps-that-talk-Introduction-to-the-Speech-Synthesis-API

install

gem install bundle
bundle

serve the pages and regenerate when there is a change

bundle exec jekyll serve --watch

build a fresh version of the site

bundle exec jekyll build --destination docs

About

Like a talking fortune cookie, Cheerful Fortune tells you a nerdy quote or interesting fact.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages