This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget-tms.rb
executable file
·76 lines (58 loc) · 2.58 KB
/
get-tms.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env ruby
# using bundler http://gembundler.com/
require 'rubygems'
require 'bundler/setup'
Bundler.require(:default)
# for options parsing
require 'optparse'
# other includes
require './api-key.rb' # BIBLE_KEY
require './models/Pack.rb' # Pack model
require './BibleApi.rb' # Bible API
# Setup BibleApi to take options for Mongo connection
options = {
:useMongo => true,
:overwrite => false,
# Recommendation: TMS has verses in both OT & NT. Pick translations with both.
:translations => [
'eng-CEV',
'eng-ESV', # English Standard Version
'eng-KJV', # King James Version
'eng-MSG',
'eng-NASB',
'spa-RVR1960'
]
}
# we want to allow some options for this file such as
# the ability to overwrite existing verses in the db
# in cases where we have changed the verse model,
# or need additional information from the API
optparse = OptionParser.new do |opts|
opts.banner = "Usage: $0 [options]"
opts.on( '-o', '--overwrite', 'Optional: replace and overwrite existing verses' ) do |overwrite|
options[:overwrite] = true
end
opts.on( '-h', '--help', 'Display help screen' ) do
puts opts
exit
end
end
optparse.parse!
bibleApi = BibleApi.new(options)
#TMS specific stuff to refactor later
a = Pack.new('A')
b = Pack.new('B')
c = Pack.new('C')
d = Pack.new('D')
e = Pack.new('E')
#packs w/ arrays of bible verse references
a.verses = ["2 Corinthians 5:17", "Galatians 2:20", "Romans 12:1", "John 14:21", "2 Timothy 3:16", "Joshua 1:8", "John 15:7", "Philippians 4:6-7", "Matthew 18:20", "Hebrews 10:24-25", "Matthew 4:19", "Romans 1:16"]
b.verses = ["Romans 3:23", "Isaiah 53:6", "Romans 6:23", "Hebrews 9:27", "Romans 5:8", "1 Peter 3:18", "Ephesians 2:8-9", "Titus 3:5", "John 1:12", "Revelation 3:20", "1 John 5:13", "John 5:24"]
c.verses = ["1 Corinthians 3:16", "1 Corinthians 2:12", "Isaiah 41:10", "Philippians 4:13", "Lamentations 3:22-23", "Numbers 23:19", "Isaiah 26:3", "1 Peter 4:7", "Romans 8:32", "Philippians 4:19", "Hebrews 2:18", "Psalm 119:9-11"]
d.verses = ["Matthew 6:33", "Luke 9:23", "1 John 2:15-16", "Romans 12:2", "1 Corinthians 15:58", "Hebrews 12:3", "Mark 10:45", "2 Corinthians 4:5", "Proverbs 3:9-10", "2 Corinthians 9:6-7", "Acts 1:8", "Matthew 28:19-20"]
e.verses = ["John 13:34-35", "1 John 3:18", "Philippians 2:3-4", "1 Peter 5:5-6", "Ephesians 5:3", "1 Peter 2:11", "Leviticus 19:11", "Acts 24:16", "Hebrews 11:6", "Romans 4:20-21", "Galatians 6:9-10", "Matthew 5:16"]
packs = [a, b, c, d, e]
# loop through each pack
packs.each do |pack|
bibleApi.get_pack_data(pack)
end