find_deals 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/README.md +18 -7
- data/db/saved_deals.sqlite3 +0 -0
- data/find_deals.gemspec +1 -1
- data/lib/find_deals/cli.rb +1 -1
- data/lib/find_deals/saved_deals.rb +4 -3
- data/lib/find_deals/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02c047e83f2444de3f44b5dfaa0497f049a7f1d4f96bfdf9164212c83c8916cc
|
4
|
+
data.tar.gz: 540282527bbf6031e430fb06593a0c40af7de5c024b0122c5df2856ef760694e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c3c8ee759504e2f57ed7ba3c62b3fa5df3003f38bbb74dafa17e23f4c25be618da3ba1860b3308b98e6b6e4e4bfca74ffa357432a0a703a1960a6095ee19656
|
7
|
+
data.tar.gz: 855068c031fe912f850f4dbce557203e2f3836c6aeff98ee45dd8fa8f63e2e56113dc3fe45af5d113b2aad02bf99e645655a3889df13e9de244bfa96f4549c25
|
data/Gemfile
CHANGED
@@ -5,7 +5,7 @@ source "https://rubygems.org"
|
|
5
5
|
# Specify your gem's dependencies in find_deals.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
|
8
|
+
|
9
9
|
gem 'activerecord', '~> 5.2', :require => 'active_record'
|
10
10
|
gem 'rake', "~> 13.0"
|
11
11
|
gem 'rubocop', "~> 1.7" #code style checker
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
find_deals (0.1.
|
4
|
+
find_deals (0.1.1)
|
5
5
|
activerecord
|
6
6
|
nokogiri
|
7
7
|
require_all
|
@@ -39,7 +39,7 @@ GEM
|
|
39
39
|
minitest (5.14.4)
|
40
40
|
mustermann (1.1.1)
|
41
41
|
ruby2_keywords (~> 0.0.1)
|
42
|
-
nokogiri (1.11.
|
42
|
+
nokogiri (1.11.6-x86_64-darwin)
|
43
43
|
racc (~> 1.4)
|
44
44
|
parallel (1.20.1)
|
45
45
|
parser (3.0.1.1)
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# FindDeals
|
2
2
|
|
3
|
-
Welcome to your
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Welcome to your this awesome find deals gem, whicgh scrapes https://www.scoopon.com.au/ and finds the best deals in a specific area, from a specific category.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,17 +20,30 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
1. Type in the number of the Australian city you're interested in viewing.
|
24
|
+
2. Type in the category you're interested in viewing (some combinations are unavailable - unfortunately there are no deals for a selection).
|
25
|
+
3. It will come up with a list of deals with their title, location, price and discount.
|
26
|
+
4. Type in a number you want to see more about
|
27
|
+
5. It will give a short description of the selected deal.
|
28
|
+
6. Specify Y or N (Yes or No) about whether you want to save the current deal.
|
29
|
+
7. If yes, it will need a username to associate the deal with the user.
|
30
|
+
8. If you click Y for Yes in the next step, it will print your saved deals.
|
31
|
+
9. You are now presented with options -
|
32
|
+
- you can type it 'more' to see more deals (it is case insensitive)
|
33
|
+
- you can type it 'city' to see your saved deals by city
|
34
|
+
- you can type it 'categories' to your saved deals by category
|
35
|
+
- you can type it 'delete' to delete one of your saved deals
|
36
|
+
10. It will then loop around to the appropriate function.
|
26
37
|
|
27
|
-
## Development
|
28
38
|
|
29
|
-
|
39
|
+
## Development
|
30
40
|
|
41
|
+
After checking out the repo, run `bin/setup` to install dependencies, which includes the database migrations.
|
31
42
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
43
|
|
33
44
|
## Contributing
|
34
45
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
46
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nils-vanderwerf/find_deals. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/nils_vanderwerf/find_deals/blob/master/CODE_OF_CONDUCT.md).
|
36
47
|
|
37
48
|
## License
|
38
49
|
|
data/db/saved_deals.sqlite3
CHANGED
Binary file
|
data/find_deals.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["n.vanderw.92@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = "A Web scraper for Scoopon to find deals and promotions"
|
12
|
-
spec.description = "Based on the users city and
|
12
|
+
spec.description = "Based on the users city and category input, they scrape a list of deals from Scoopon.com. They have they choice to save to the database and view their saved deals."
|
13
13
|
spec.homepage = "https://github.com/nils-vanderwerf/find_deals/"
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
data/lib/find_deals/cli.rb
CHANGED
@@ -15,8 +15,9 @@ class SavedDeals < ActiveRecord::Base
|
|
15
15
|
puts "===================================================================="
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.delete_from_db(user_input)
|
19
|
-
|
20
|
-
|
18
|
+
def self.delete_from_db(user, user_input)
|
19
|
+
selected_user_deals = SavedDeals.select {|deal| deal.user_id == user.id}
|
20
|
+
title_to_delete = selected_user_deals[user_input-1].title
|
21
|
+
SavedDeals.where(title: title_to_delete).destroy_all
|
21
22
|
end
|
22
23
|
end
|
data/lib/find_deals/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: find_deals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nils-vanderwerf
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -122,9 +122,9 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
description: Based on the users city and
|
126
|
-
from Scoopon.com. They have they
|
127
|
-
|
125
|
+
description: Based on the users city and category input, they scrape a list of deals
|
126
|
+
from Scoopon.com. They have they choice to save to the database and view their saved
|
127
|
+
deals.
|
128
128
|
email:
|
129
129
|
- n.vanderw.92@gmail.com
|
130
130
|
executables: []
|