diffbot 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35d6b7f9cfea3baed8bce0a8f4c858ecd9aa6329
4
- data.tar.gz: a9276c70d867748eb8be81cb9dd14d6ef30bddd6
3
+ metadata.gz: 6f8ea1f3692e229ebe7c1006891379a133f04e02
4
+ data.tar.gz: d1344209d354c02801ceb90fa5fb142df5dd82eb
5
5
  SHA512:
6
- metadata.gz: 19a67f552b510e4d3774c1594a8bb2a4712b4ffa996390a6d52d57ca84cd3b09fb6ac30847cddd05767ab910f05fde909d18bc5ec5454930ae05ac4d792623c2
7
- data.tar.gz: 178401466e3697b83295c08773a583075592bc9bb75d5e701d7e3bd5a49f3536091ff2dd528614389797d11bca9d6c0ce7a03afd022d8308d3e7f14ad2f06b02
6
+ metadata.gz: 726c4164894d6f740d8ab80e5ca94d5783af8caf5598e0712852c530f9a90a08aae12860a25e8974ceca95210a38e7415f91ceb2062cf4812c929f1d21cee108
7
+ data.tar.gz: c8730083d82eacfc945fcf573418326daaf1b914efe495d88e55d3478cd291896dd0535523b0bc81452e7793c503c0928e7e7d7e1bfe01680018d17bdf22958e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- diffbot (0.1.3)
4
+ diffbot (0.1.4)
5
5
  excon
6
6
  hashie
7
7
  nokogiri (~> 1.5.0)
data/README.md CHANGED
@@ -119,6 +119,48 @@ The instances of `Diffbot::Item` have the following fields:
119
119
  * `fresh`: The percentage of the item that has changed compared to the
120
120
  previous crawl.
121
121
 
122
+ ## Products
123
+
124
+ In order to fetch a product, do this:
125
+
126
+ ``` ruby
127
+ require "diffbot"
128
+
129
+ product = Diffbot::Product.fetch(article_url, diffbot_token)
130
+
131
+ # Now you can inspect the result:
132
+ product.products
133
+ product.type
134
+ product.url
135
+ # etc. See below for the full list of available response attributes.
136
+ ```
137
+
138
+ This is a list of all the fields returned by the `Diffbot::Product.fetch` call:
139
+
140
+ * `breadcrumb`: an array of link URLs and text from page breadcrumbs
141
+ * `name`: text
142
+ * `link`: an URL
143
+ * `date_created`: date of publishing product
144
+ * `type`: response type
145
+ * `products`: array of products
146
+ * `title`: name of the product
147
+ * `description`: description, if available, of the product
148
+ * `offer_price`: identified offer or actual/'final' price
149
+ * `product_id`: unique product's id
150
+ * `availability`: item's availability, either true or false
151
+ * `offer_price_details`: price details
152
+ * `amount`:
153
+ * `text`:
154
+ * `symbol`:
155
+ * `media`: array of media items (images or videos) of the product.
156
+ * `primary`: only images, returns `true` if image is identified as primary
157
+ * `link`: link to image or video content.
158
+ * `caption`: caption for the image.
159
+ * `type`: type of media identified (image or video).
160
+ * `height`: image height, in pixels.
161
+ * `width`: image width, in pixels.
162
+ * `xpath`: full document Xpath to the media item.
163
+
122
164
  ## TODO
123
165
 
124
166
  * Implement the Follow API.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "diffbot"
3
- s.version = "0.1.3"
3
+ s.version = "0.1.4"
4
4
  s.description = "Diffbot provides a concise API for analyzing and extracting semantic information from web pages using Diffbot (http://www.diffbot.com)."
5
5
  s.summary = "Ruby interface to the Diffbot API "
6
6
  s.authors = ["Nicolas Sanguinetti", "Roman Greshny"]
@@ -53,9 +53,6 @@ module Diffbot
53
53
 
54
54
  property :type
55
55
 
56
- property :offer_price_details, from: :offerPriceDetails
57
-
58
-
59
56
  # Products array
60
57
  property :products
61
58
  coerce_property :products, collection: Items::Product
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diffbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Sanguinetti