ioffer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +5 -2
- data/Gemfile +1 -0
- data/README.md +23 -17
- data/lib/ioffer/search.rb +1 -1
- data/lib/ioffer/version.rb +1 -1
- metadata +3 -3
data/ChangeLog.md
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0 / 2011-04-10
|
2
|
+
------------------
|
3
|
+
* Add explicit `#search`
|
4
|
+
|
5
|
+
0.1.1 / 2011-04-04
|
2
6
|
------------------
|
3
7
|
* Bugs:
|
4
8
|
* Added runtime dependencies.
|
5
9
|
|
6
10
|
0.1.0 / 2011-04-04
|
7
11
|
------------------
|
8
|
-
|
9
12
|
* Initial release:
|
10
13
|
* Basic search and page parser.
|
11
14
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -18,27 +18,33 @@ Features
|
|
18
18
|
Examples
|
19
19
|
--------
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
21
|
+
require 'ioffer'
|
22
|
+
require 'open-uri'
|
23
|
+
|
24
|
+
search = IOfferSearch.parse open("http://www.ioffer.com/si/saxphones")
|
25
|
+
|
26
|
+
search.results.each do |result|
|
27
|
+
puts result.title
|
28
|
+
puts result.url
|
29
|
+
end
|
30
|
+
|
31
|
+
result_url = search.results.first.url
|
32
|
+
|
33
|
+
page = IOfferPage.parse open(result_url)
|
34
|
+
puts page.seller_name
|
35
|
+
puts page.item_id
|
36
|
+
puts page.price
|
37
37
|
|
38
38
|
Install
|
39
39
|
-------
|
40
40
|
|
41
|
-
|
41
|
+
$ gem install ioffer
|
42
|
+
|
43
|
+
Todo
|
44
|
+
----
|
45
|
+
|
46
|
+
* Add `#search`
|
47
|
+
* Add tests
|
42
48
|
|
43
49
|
Copyright
|
44
50
|
---------
|
data/lib/ioffer/search.rb
CHANGED
@@ -4,7 +4,7 @@ class IOfferSearchResults < Nibbler
|
|
4
4
|
end
|
5
5
|
|
6
6
|
class IOfferSearch < Nibbler
|
7
|
-
elements 'div
|
7
|
+
elements 'div.search-results-list-item' => :results,
|
8
8
|
:with => IOfferSearchResults
|
9
9
|
element 'span[@class="current"]' => :current_page
|
10
10
|
element 'a[@class="next_page"]/@href' => :next_page_url
|
data/lib/ioffer/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ioffer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ezekiel Templin
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-14 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nibbler
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
requirements: []
|
119
119
|
|
120
120
|
rubyforge_project: ioffer
|
121
|
-
rubygems_version: 1.7.
|
121
|
+
rubygems_version: 1.7.2
|
122
122
|
signing_key:
|
123
123
|
specification_version: 3
|
124
124
|
summary: Basic iOffer Search/Page Parser
|