tunespi 1.1.6

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/tunespi.rb +39 -0
  3. metadata +46 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 16e53bfbae5cc6375dbb190cfa16602951972f52
4
+ data.tar.gz: d7fb2a8538cc672e186c5ed110d58dd71106fd7a
5
+ SHA512:
6
+ metadata.gz: 51b0b606a5856d93959ea6683ae973df5f8abdf28b865a8ef499f437a0b0ace92931147392260d5112f6a220dcc3ff11602676573e8d0ae5bdfcad6950207237
7
+ data.tar.gz: 2131c61b8aa00cfbfe654e540835eaebcc95a55b03e01508974bdabdce53a9b4e8e668e83dad593f521e273b9caac3e462432fa17c9aef326bbd9eaa753a7afe
data/lib/tunespi.rb ADDED
@@ -0,0 +1,39 @@
1
+ # require 'net/http'
2
+ # require 'json'
3
+ # require 'awesome_print'
4
+
5
+ module TunesPI
6
+
7
+ class Tuner
8
+
9
+ # sets definable attribute for search term
10
+ attr_accessor :search
11
+
12
+ def get_and_parse(uri)
13
+ response = Net::HTTP.get(uri) # => String
14
+ parsed = JSON.parse(response)
15
+ a = []
16
+
17
+ # for each result, we want to make a hash of the specific results attributes, and put that
18
+ # hash in an array
19
+ parsed["results"].each do |x|
20
+ a << Movie.new(name: x["trackName"], art: x["artworkUrl100"])
21
+ end
22
+ return a
23
+ end
24
+
25
+ def search_movies
26
+ q = URI.encode(self.search)
27
+ puts = "ENCODED"
28
+ puts q
29
+ puts "************"
30
+
31
+ uri = URI("https://itunes.apple.com/search?term=#{q}&entity=movie")
32
+ get_and_parse(uri)
33
+ end
34
+
35
+ # include Apps
36
+
37
+ end
38
+
39
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tunespi
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.6
5
+ platform: ruby
6
+ authors:
7
+ - Jon Wexler
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Look for movies, music, and other media through Itunes library with this
14
+ gem.
15
+ email:
16
+ - jon@nycda.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/tunespi.rb
22
+ homepage: https://github.com/jonathanwexler/tunespi
23
+ licenses:
24
+ - GPLv2
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 1.9.3
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.4.5.1
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Pull songs from Itunes API.
46
+ test_files: []