noawsalbumart 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -5
- data/lib/noawsalbumart/version.rb +1 -1
- data/lib/noawsalbumart.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45ad60d40151f5c08466f500ffcf19d2ea08c30a
|
|
4
|
+
data.tar.gz: 2498910d0a90e4135285669bd9d0cfceab5a0c81
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e78a5807a8a11c8a9e585a2cce47c8da2c8c2c037bdd49b0c3eee759aa72f3caf281abdf096cba9bc0933c209ca325cf92957c6c5382cbfadf9918cea9ff5c45
|
|
7
|
+
data.tar.gz: bf8f0ab57df1cbfed6d7747281e1c4518f2be3f29a88bf63ff6c357a3d3e8a848cee0443e2c37635a86d8cf7dd63a787ba831d8802d724a59f7c4832ccf9959b
|
data/README.md
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
# Noawsalbumart
|
|
2
2
|
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/noawsalbumart`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
6
|
-
|
|
7
3
|
## Installation
|
|
8
4
|
|
|
9
5
|
Add this line to your application's Gemfile:
|
|
@@ -22,7 +18,9 @@ Or install it yourself as:
|
|
|
22
18
|
|
|
23
19
|
## Usage
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
NoAWSAlbumArt was mainly an exercise in building an alternative to Amazon Album Art, which works great, but does depend on having an AWS account. This gem simply scrapes Amazon's search result's with a hard-code query, a fairly brute force method and fragile to amazon's changes of their search bar.
|
|
22
|
+
|
|
23
|
+
I mainly chose to use amazon simply because of image normalization for most album art at certain sizes.
|
|
26
24
|
|
|
27
25
|
## Development
|
|
28
26
|
|
data/lib/noawsalbumart.rb
CHANGED
|
@@ -9,7 +9,7 @@ module Noawsalbumart
|
|
|
9
9
|
query = query_string(artist_name, album_name)
|
|
10
10
|
retries = 3
|
|
11
11
|
begin
|
|
12
|
-
doc = Nokogiri::HTML(open("http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=#{query}&rh=i%3Aaps%2Ck%3A#{query}"))
|
|
12
|
+
doc = Nokogiri::HTML(open("http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=#{query}&rh=i%3Aaps%2Ck%3A#{query}").read, nil, 'utf-8')
|
|
13
13
|
rescue OpenURI::HTTPError => error
|
|
14
14
|
response = error.io
|
|
15
15
|
puts response.status
|