diffbot 0.1.3 → 0.1.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +42 -0
- data/diffbot.gemspec +1 -1
- data/lib/diffbot/product.rb +0 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f8ea1f3692e229ebe7c1006891379a133f04e02
|
4
|
+
data.tar.gz: d1344209d354c02801ceb90fa5fb142df5dd82eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 726c4164894d6f740d8ab80e5ca94d5783af8caf5598e0712852c530f9a90a08aae12860a25e8974ceca95210a38e7415f91ceb2062cf4812c929f1d21cee108
|
7
|
+
data.tar.gz: c8730083d82eacfc945fcf573418326daaf1b914efe495d88e55d3478cd291896dd0535523b0bc81452e7793c503c0928e7e7d7e1bfe01680018d17bdf22958e
|
data/Gemfile.lock
CHANGED
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.
|
data/diffbot.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "diffbot"
|
3
|
-
s.version = "0.1.
|
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"]
|
data/lib/diffbot/product.rb
CHANGED