apple_store_search 0.0.3
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.
- data/.gitignore +4 -0
- data/.yardoc/checksums +2 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +2 -0
- data/Gemfile +6 -0
- data/README.md +25 -0
- data/Rakefile +1 -0
- data/apple_store_search.gemspec +24 -0
- data/doc/AppleStoreSearch/Search.html +277 -0
- data/doc/AppleStoreSearch.html +120 -0
- data/doc/_index.html +112 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file_list.html +46 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +112 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +167 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +62 -0
- data/doc/top-level-namespace.html +103 -0
- data/lib/apple_store_search/version.rb +3 -0
- data/lib/apple_store_search.rb +61 -0
- metadata +70 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
+
|
17
|
+
|
18
|
+
<base id="base_target" target="_parent" />
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
<script type="text/javascript" charset="utf-8">
|
22
|
+
if (window.top.frames.main) {
|
23
|
+
document.getElementById('base_target').target = 'main';
|
24
|
+
document.body.className = 'frames';
|
25
|
+
}
|
26
|
+
</script>
|
27
|
+
<div id="content">
|
28
|
+
<h1 id="full_list_header">Method List</h1>
|
29
|
+
<div id="nav">
|
30
|
+
|
31
|
+
<a target="_self" href="class_list.html">Classes</a>
|
32
|
+
|
33
|
+
<a target="_self" href="method_list.html">Methods</a>
|
34
|
+
|
35
|
+
<a target="_self" href="file_list.html">Files</a>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
<div id="search">Search: <input type="text" /></div>
|
39
|
+
|
40
|
+
<ul id="full_list" class="methods">
|
41
|
+
|
42
|
+
|
43
|
+
<li class="r1 ">
|
44
|
+
<span class='object_link'><a href="AppleStoreSearch/Search.html#initialize-instance_method" title="AppleStoreSearch::Search#initialize (method)">#initialize</a></span>
|
45
|
+
|
46
|
+
<small>AppleStoreSearch::Search</small>
|
47
|
+
|
48
|
+
</li>
|
49
|
+
|
50
|
+
|
51
|
+
<li class="r2 ">
|
52
|
+
<span class='object_link'><a href="AppleStoreSearch/Search.html#search-instance_method" title="AppleStoreSearch::Search#search (method)">#search</a></span>
|
53
|
+
|
54
|
+
<small>AppleStoreSearch::Search</small>
|
55
|
+
|
56
|
+
</li>
|
57
|
+
|
58
|
+
|
59
|
+
</ul>
|
60
|
+
</div>
|
61
|
+
</body>
|
62
|
+
</html>
|
@@ -0,0 +1,103 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Top Level Namespace
|
8
|
+
|
9
|
+
— Documentation by YARD 0.7.4
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
relpath = '';
|
19
|
+
if (relpath != '') relpath += '/';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
25
|
+
|
26
|
+
|
27
|
+
</head>
|
28
|
+
<body>
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
<div id="menu">
|
35
|
+
|
36
|
+
<a href="_index.html">Index</a> »
|
37
|
+
|
38
|
+
|
39
|
+
<span class="title">Top Level Namespace</span>
|
40
|
+
|
41
|
+
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="search">
|
46
|
+
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
48
|
+
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
50
|
+
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
<div class="clear"></div>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<iframe id="search_frame"></iframe>
|
58
|
+
|
59
|
+
<div id="content"><h1>Top Level Namespace
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
</h1>
|
64
|
+
|
65
|
+
<dl class="box">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
</dl>
|
75
|
+
<div class="clear"></div>
|
76
|
+
|
77
|
+
<h2>Defined Under Namespace</h2>
|
78
|
+
<p class="children">
|
79
|
+
|
80
|
+
|
81
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="AppleStoreSearch.html" title="AppleStoreSearch (module)">AppleStoreSearch</a></span>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
</p>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<div id="footer">
|
97
|
+
Generated on Tue Jan 3 10:46:40 2012 by
|
98
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
99
|
+
0.7.4 (ruby-1.9.2).
|
100
|
+
</div>
|
101
|
+
|
102
|
+
</body>
|
103
|
+
</html>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require "apple_store_search/version"
|
2
|
+
|
3
|
+
module AppleStoreSearch
|
4
|
+
# Your code goes here...
|
5
|
+
class Search
|
6
|
+
#initialization
|
7
|
+
def initialize
|
8
|
+
@base_url="http://itunes.apple.com/search?"
|
9
|
+
#@curl = CURL.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def search(options,selected)
|
13
|
+
@base_url=load_options(options)
|
14
|
+
search_parse
|
15
|
+
if @data.has_key?('errorMessage')
|
16
|
+
puts "Invalid key-value pair(s) in request"
|
17
|
+
return
|
18
|
+
end
|
19
|
+
get_selected(selected)
|
20
|
+
return @result
|
21
|
+
#puts @data
|
22
|
+
end
|
23
|
+
|
24
|
+
protected
|
25
|
+
|
26
|
+
def get_selected(selected)
|
27
|
+
if selected[0].nil?
|
28
|
+
@result= @data['results']
|
29
|
+
return
|
30
|
+
end
|
31
|
+
count=@data['resultCount']
|
32
|
+
j=0
|
33
|
+
@result=Hash.new
|
34
|
+
@data['results'].each do |data|
|
35
|
+
i=0
|
36
|
+
@set=Array.new
|
37
|
+
selected.each do |key|
|
38
|
+
#@result[j] << data[key]
|
39
|
+
@set.push(data[key])
|
40
|
+
end
|
41
|
+
@result[j]=@set
|
42
|
+
j+=1
|
43
|
+
end
|
44
|
+
#puts @result
|
45
|
+
end
|
46
|
+
|
47
|
+
def search_parse #(selected)
|
48
|
+
curl = CURL.new
|
49
|
+
page = curl.get_raw(@base_url)
|
50
|
+
@data= JSON.parse(page)
|
51
|
+
return @data
|
52
|
+
end
|
53
|
+
|
54
|
+
def load_options(opt)
|
55
|
+
opt.each_with_index do |(key,value),index|
|
56
|
+
@base_url << "#{key}=#{value}&"
|
57
|
+
end
|
58
|
+
return @base_url
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: apple_store_search
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Shamith c
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-11 00:00:00.000000000Z
|
13
|
+
dependencies: []
|
14
|
+
description: Exited to watch its progress
|
15
|
+
email: shamithc@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- .gitignore
|
21
|
+
- .yardoc/checksums
|
22
|
+
- .yardoc/objects/root.dat
|
23
|
+
- .yardoc/proxy_types
|
24
|
+
- Gemfile
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- apple_store_search.gemspec
|
28
|
+
- doc/AppleStoreSearch.html
|
29
|
+
- doc/AppleStoreSearch/Search.html
|
30
|
+
- doc/_index.html
|
31
|
+
- doc/class_list.html
|
32
|
+
- doc/css/common.css
|
33
|
+
- doc/css/full_list.css
|
34
|
+
- doc/css/style.css
|
35
|
+
- doc/file_list.html
|
36
|
+
- doc/frames.html
|
37
|
+
- doc/index.html
|
38
|
+
- doc/js/app.js
|
39
|
+
- doc/js/full_list.js
|
40
|
+
- doc/js/jquery.js
|
41
|
+
- doc/method_list.html
|
42
|
+
- doc/top-level-namespace.html
|
43
|
+
- lib/apple_store_search.rb
|
44
|
+
- lib/apple_store_search/version.rb
|
45
|
+
homepage: ''
|
46
|
+
licenses: []
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project: apple_store_search
|
65
|
+
rubygems_version: 1.8.11
|
66
|
+
signing_key:
|
67
|
+
specification_version: 3
|
68
|
+
summary: This is for searching in app in apple store
|
69
|
+
test_files: []
|
70
|
+
has_rdoc:
|