dealmap 0.0.3 → 0.0.4
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/README.md +25 -4
- data/lib/dealmap/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
Simple Ruby wrapper for the Dealmap [API](http://www.thedealmap.com/api/). [TheDealMap](http://thedealmap.com) features deals aggregated from a number of sources, includng Groupon, LivingSocial, Restaurants.com, and more.
|
4
4
|
|
5
|
+
|
5
6
|
## Installation
|
6
7
|
|
7
8
|
sudo gem install dealmap
|
@@ -10,22 +11,37 @@ Simple Ruby wrapper for the Dealmap [API](http://www.thedealmap.com/api/). [TheD
|
|
10
11
|
|
11
12
|
You'll need a Dealmap [API key](http://www.thedealmap.com/api/keys/).
|
12
13
|
|
14
|
+
### Instantiate
|
13
15
|
require 'dealmap'
|
14
16
|
client = Dealmap::Client.new(YOUR_API_KEY)
|
15
17
|
|
16
18
|
### Searching for deals in Brooklyn, NY
|
17
19
|
deals, total = client.search_deals(:l => "Brooklyn, NY")
|
18
20
|
|
21
|
+
### Searching for deals in Brooklyn, NY, return 100 results.
|
22
|
+
deals, total = client.search_deals(:l => "Brooklyn, NY", :ps => 100)
|
23
|
+
|
24
|
+
### Searching for beer deals in Brooklyn, NY, return 100 results.
|
25
|
+
deals, total = client.search_deals(:l => "Brooklyn, NY", :ps => 100, :q => "beer")
|
26
|
+
|
27
|
+
### Searching for beer deals within 10 miles of Brooklyn, NY, return 100 results.
|
28
|
+
deals, total = client.search_deals(:l => "Brooklyn, NY", :ps => 100, :q => "beer", :d => 10)
|
29
|
+
|
19
30
|
### Searching for deals based on lat/lng (Brooklyn, NY)
|
20
31
|
deals, total = client.search_deals(:l => "40.6500000, -73.9500000")
|
21
32
|
|
22
|
-
|
33
|
+
### Get deal details
|
34
|
+
deal = client.deal_details(DEAL_ID)
|
23
35
|
|
24
|
-
|
36
|
+
Dealmap uses a [`Hashie::Mash`](https://github.com/intridea/hashie) for return values, providing a handy hash that supports dot notation:
|
37
|
+
|
38
|
+
deal.title
|
25
39
|
=> "$100 Gift Certificate, Your Price $40"
|
26
|
-
|
40
|
+
deal.city
|
27
41
|
=> "Brooklyn"
|
28
|
-
|
42
|
+
### Issues
|
43
|
+
GitHub issue tracking sucks. Submit issues to [`Lighthouse`](https://dealmap.lighthouseapp.com)
|
44
|
+
|
29
45
|
<a name="changelog"></a>
|
30
46
|
## Changelog
|
31
47
|
|
@@ -33,6 +49,11 @@ Dealmap uses a [`Hashie::Mash`](http://github.com/intridea/hashie) for return va
|
|
33
49
|
|
34
50
|
* Initial version
|
35
51
|
|
52
|
+
## Under the hood
|
53
|
+
* [`Faraday`](https://github.com/technoweenie/faraday) REST client
|
54
|
+
* [`Typhoeus`](https://github.com/dbalatero/typhoeus) HTTP library
|
55
|
+
* [`Hashie::Mash`](http://github.com/intridea/hashie) Magic
|
56
|
+
|
36
57
|
## How to contribute
|
37
58
|
|
38
59
|
* Fork the project.
|
data/lib/dealmap/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dealmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Joshua Deeden
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-14 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|