goodwill 0.4.4 → 0.4.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.
- checksums.yaml +4 -4
- data/lib/goodwill/account.rb +3 -1
- data/lib/goodwill/cli.rb +12 -2
- data/lib/goodwill/csspaths.rb +2 -0
- data/lib/goodwill/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4179a1b7a46965ea77ed93238d5627d89e7bc1463c7c5a2aef0be750cab52d6e
|
|
4
|
+
data.tar.gz: 353fe9f4c623e93ea19554591840733a2436c9a1e2bd07a86da104b4f0b0029e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c634d19b4480caa3b7d1b54680b16078cfb5c182dd8ed1aac7367b3681c0593ad87fe0c45589ded56e71cfe7561371f124a43b9fbaec3fb007bb9df8c9ad86de
|
|
7
|
+
data.tar.gz: 204669e69d251295d875a94ebb4f0f760afd2017945d1be77a5333309811923c0f21fd53a1ee885088ab10903a946564e187c1755f81d965dcde2451d937ca2f
|
data/lib/goodwill/account.rb
CHANGED
|
@@ -101,7 +101,9 @@ module Goodwill
|
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
def total_items(page)
|
|
104
|
-
page.search(
|
|
104
|
+
return 0 unless page.search(NO_ITEMS_FOUND_PATH).empty?
|
|
105
|
+
|
|
106
|
+
page.search(ITEMS_COUNT_PATH).first.text.split(' of ')[1].split(' ').first.to_i
|
|
105
107
|
end
|
|
106
108
|
end
|
|
107
109
|
end
|
data/lib/goodwill/cli.rb
CHANGED
|
@@ -22,13 +22,23 @@ module Goodwill
|
|
|
22
22
|
desc 'auctions', "List all auctions you're currently bidding on"
|
|
23
23
|
def auctions
|
|
24
24
|
say "Your current auctions:\n"
|
|
25
|
-
|
|
25
|
+
res = @account.in_progress
|
|
26
|
+
if res.empty?
|
|
27
|
+
puts 'No items found.'
|
|
28
|
+
else
|
|
29
|
+
tp res
|
|
30
|
+
end
|
|
26
31
|
end
|
|
27
32
|
|
|
28
33
|
desc 'search SEARCH', 'Search for auctions matching SEARCH'
|
|
29
34
|
def search(search)
|
|
30
35
|
say 'Your search results:'
|
|
31
|
-
|
|
36
|
+
res = @account.search(search)
|
|
37
|
+
if res.empty?
|
|
38
|
+
puts 'No items found.'
|
|
39
|
+
else
|
|
40
|
+
tp res
|
|
41
|
+
end
|
|
32
42
|
end
|
|
33
43
|
|
|
34
44
|
desc 'bid ITEMID MAXBID', 'Bid MAXBID on ITEMID'
|
data/lib/goodwill/csspaths.rb
CHANGED
|
@@ -11,7 +11,9 @@ module Goodwill
|
|
|
11
11
|
END_TIME_PATH = '/html/body/section/div[2]/div[3]/div[2]/ul[2]/li[10]'
|
|
12
12
|
IN_PROGRESS_ROWS = '#my-auctions-table > tbody > tr'
|
|
13
13
|
ITEMID_PATH = 'body > span > div.itemdetail > div:nth-child(2) > div:nth-child(2) > div > table > tbody > tr:nth-child(3) > td'
|
|
14
|
+
ITEMS_COUNT_PATH = '//*[@id="search-results"]/div/div[1]/nav[1]/p'
|
|
14
15
|
ITEM_TITLE_PATH = 'body > section > div.container > div:nth-child(3) > div:nth-child(2) > h1'
|
|
16
|
+
NO_ITEMS_FOUND_PATH = '/html/body/section/div[2]/div[4]/div[2]/div/div[2]/p'
|
|
15
17
|
SEARCH_ROWS = '#search-results > div > section > ul.products > li'
|
|
16
18
|
SELLER_ID_LINK = '/html/body/section/div[2]/div[4]/div/section/div/ul/li[4]/a'
|
|
17
19
|
SELLER_PATH = 'body > section > div.container > div:nth-child(3) > div:nth-child(2) > ul.product-data > li:nth-child(8) > a'
|
data/lib/goodwill/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: goodwill
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brandon Burnett
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-07-
|
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gem-release
|