razsell 0.0.6 → 0.0.7
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/Rakefile +13 -0
- data/VERSION +1 -1
- data/lib/razsell/results.rb +1 -1
- data/lib/razsell.rb +3 -2
- data/razsell.gemspec +1 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
3
|
|
4
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
5
|
+
require 'razsell'
|
6
|
+
include Razsell
|
7
|
+
|
4
8
|
begin
|
5
9
|
require 'jeweler'
|
6
10
|
Jeweler::Tasks.new do |gem|
|
@@ -67,3 +71,12 @@ Rake::RDocTask.new do |rdoc|
|
|
67
71
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
68
72
|
end
|
69
73
|
|
74
|
+
namespace :products do
|
75
|
+
desc "Returns a list of products for an artist"
|
76
|
+
task :for, :artist do |t, args|
|
77
|
+
abort "Please pass a data_root path like: rake products:for['my_login']" unless args[:artist]
|
78
|
+
|
79
|
+
results = products_for args[:artist]
|
80
|
+
results.items.sort {|x,y| x.title <=> y.title }.each { |p| puts p.title }
|
81
|
+
end
|
82
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/lib/razsell/results.rb
CHANGED
@@ -25,7 +25,7 @@ module Razsell
|
|
25
25
|
item_hash = {}
|
26
26
|
item_hash[:title] = strip_cdata(item.at("title").inner_html)
|
27
27
|
item_hash[:guid] = item.at("guid").inner_html
|
28
|
-
item_hash[:pub_date] =
|
28
|
+
item_hash[:pub_date] = Time.parse(item.at("pubDate").inner_html)
|
29
29
|
item_hash[:link] = item.at("link").inner_html
|
30
30
|
item_hash[:author] = item.at("author").inner_html
|
31
31
|
item_hash[:description] = strip_cdata(item.at("media:description").inner_html)
|
data/lib/razsell.rb
CHANGED
@@ -10,8 +10,9 @@ module Razsell
|
|
10
10
|
engine.request(query)
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def products_for artist, opts={}
|
14
14
|
engine = Razsell::Engine.new opts
|
15
|
-
|
15
|
+
query = Razsell::Query.new.for_artist(artist)
|
16
|
+
engine.request(query)
|
16
17
|
end
|
17
18
|
end
|
data/razsell.gemspec
CHANGED