This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BobikClient bobik = new BobikClient("YOUR_AUTH_KEY"); | |
JSONObject request = new JSONObject(); | |
for (String url : new String[]{"amazon.com", "google.com"}) | |
request.accumulate("urls", url); | |
for (String query : new String[]{"//a/@href", "return $('.logo').length"}) | |
request.accumulate("queries", query); | |
Job job = bobik.scrape(request, new JobListener() { | |
public void onSuccess(JSONObject scraped_data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
// Download Bobik SDK from http://usebobik.com/sdk | |
import android.util.Log; | |
import bobik.BobikClient; | |
import bobik.BobikHelper; | |
import bobik.Job; | |
import bobik.JobListener; | |
import org.json.JSONException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cvs" => { | |
"Image" => "//div[@class='productSection1']//img[1]/@src", | |
"Title" => "//h4[@class='productBrand']//span[1]", | |
"Size" => "//span[@class='prodWeight']/preceding-sibling::text()[1]", | |
"Price" => "//*[@class='productPrice']", | |
"Link" => "//div[@class='productSection1']//img[1]/ancestor::a/@href" | |
}, | |
"walgreens" => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import android.util.Log; | |
// Download Bobik SDK from http://usebobik.com/sdk | |
import bobik.BobikClient; | |
import bobik.Job; | |
import bobik.JobListener; | |
import org.json.JSONArray; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This example shows how to collect restaurant information and menus on the fly. | |
*/ | |
// Instantiate Bobik client from Bobik SDK available at http://usebobik.com/sdk. | |
// You're welcome to link directly to the JS file. However we make no guarantees about keeping the link unchanged. | |
// Thus, you should do it only when you have a quick and immediate access to where this url is used (e.g. during development) | |
var bobik = new Bobik("YOUR_AUTH_TOKEN"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Demonstrates how to scrape using different query types | |
*/ | |
var urls = ['amazon.com', 'zynga.com', 'http://finance.google.com/', 'http://shopping.yahoo.com'] | |
var queries = ["//th", "//img/@src", "return document.title", "return $('script').length", "#logo", ".logo"] | |
// Instantiate Bobik client from Bobik SDK available at http://usebobik.com/sdk. | |
// You're welcome to link directly to the JS file. However we make no guarantees about keeping the link unchanged. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demonstrates synchronous scraping using Bobik | |
# To make this example asynchronous, simply change `true` to `false` in calling `scrape`. | |
client = Bobik::Client.new(:auth_token => YOUR_AUTH_TOKEN, :timeout_ms => 60000) | |
sample_data = { | |
urls: ['amazon.com', 'zynga.com', 'http://finance.yahoo.com/'], | |
queries: ["//th", "//img/@src", "return document.title", "return $('script').length"] | |
} |