Project

ebooks

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Generate your own horse_ebooks for fun and for profit
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Ebooks

Generate your own horse_ebooks by @busterbenson (original gist, blog post) and compiled as a gem by @parkr

Build Status Dependency Status Code Climate Gem Version License Badges

Installation

Add this line to your application's Gemfile:

gem 'ebooks'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ebooks

Configuration

The ebooks executable and Ebooks.read_config_file will load in a yaml file (~/.ebooks by default) if you want to set your own defaults.

Here are the gem's defaults:

:tweets_csv_path: 'tweets.csv'
:corpus_path:     'markov_dict.txt'
:dictionary_name: 'dictionary'
:twitter:
  :consumer_key: ''
  :consumer_secret: ''
  :oauth_token: ''
  :oauth_token_secret: ''

Usage

As an API:

config = Ebooks.configuration(my_overrides)

# Generate a sentence and return it
Ebooks.generate(config)

# Generate sentence and tweet it
Ebooks.tweet(config)

# Just tweet a sentence
Ebooks::Twitter.new(config[:twitter]).tweet(my_sentence)

As an executable:

# To generate a new horse_ebooks sentence:
ebooks generate

# To generate a new sentence and tweet it:
ebooks tweet

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request