We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03b3d3e commit 28d31c1Copy full SHA for 28d31c1
kanye.rb
@@ -1,4 +1,4 @@
1
-require 'httparty'
+require 'retort_api'
2
require 'rhymes'
3
4
rhyme_schemes = {
@@ -16,21 +16,12 @@
16
17
# Generate a random word that we've seen Kanye use prior to the given word
18
def previous_word after
19
- url = "http://www.retort.us/bigram/prior?after=#{after}&medium=bible"
20
- json = JSON.parse(HTTParty.get(url).body)
21
-
22
- puts "#{json['prior']} --> #{after}"
23
24
- json["prior"]
25
-rescue
26
- puts "No words found prior to #{after}"
27
- nil
+ RetortApi.get_word_before(after, identity: { medium: 'bible' })
28
end
29
30
# Generate a fully random line
31
def full_line
32
- url = "http://www.retort.us/markov/create?medium=bible"
33
- HTTParty.get(url).body
+ RetortApi.markov_chain(identity: { medium: 'bible' })
34
35
36
# Returns all possible rhymes for a word
0 commit comments