kbapibooks 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/kbapibooks.rb +16 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 216ad82da184abeeda14ead1866d536a35defbcc96450469e7b9340236ee31d9
|
4
|
+
data.tar.gz: d1b14c526b2483ab0a70da61dee9f92bb01f9108483f3682ca1e19429535cd33
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 152841c806bbea5661e3f978aaf512cceca085197df248da9e1b3a939f2f80aa1113bb15da1e2abf91f5a2e727870bd1a19dbd71522a99d0b401d3bba51d2728
|
7
|
+
data.tar.gz: a3591d78bf4d49a7d26339547f06d7e61242f1622b10b7aa4ee387184e5649419c16019d6d3405a6e19b06848a791b3471d5c1dccb69571a061380b934bcec1c
|
data/lib/kbapibooks.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# Books GEM queries Google Books API by title
|
2
|
+
#
|
3
|
+
require 'httparty'
|
4
|
+
require 'singleton'
|
5
|
+
|
6
|
+
class Books
|
7
|
+
include Singleton
|
8
|
+
def self.list_books(author, api_key)
|
9
|
+
format_author = author.gsub(' ', '+') if author.match(/\s/)
|
10
|
+
url = "https://www.googleapis.com/books/v1/volumes?q=inauthor:#{format_author}&key=#{api_key}"
|
11
|
+
puts 'VERSION 0.5.0'
|
12
|
+
response = HTTParty.get(url)
|
13
|
+
puts "RESPONSE CODE #{response.code}"
|
14
|
+
response.parsed_response
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kbapibooks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Brennan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-03-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: httparty
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: A simple gem that calls a Google API
|
42
|
+
email: x16149823@student.ncirl.ie
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- lib/kbapibooks.rb
|
48
|
+
homepage: http://github.com/kevinbrennanio
|
49
|
+
licenses: []
|
50
|
+
metadata: {}
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubygems_version: 3.2.3
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: Books GEM that lists books from Google Books
|
70
|
+
test_files: []
|