Socket
Book a DemoInstallSign in
Socket

bobik

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bobik

0.0.5
bundlerRubygems
Version published
Maintainers
1
Created
Source

Web Scraping in Ruby using Bobik

This is a community-supported Bobik SDK for web scraping in Ruby.

Installing

  • Either install directly and system-wide:

    • Run gem install bobik from command line
    • Add require 'bobik' to your Ruby code
  • Or, add to bundler:

    • add gem 'bobik' to Gemfile
    • Unless you're using Rails (which includes all gems from Gemfile automatically), add require 'bobik' to your Ruby code

Using

Here's a quick example to get you started.

  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"]
  }
  
  client.scrape(sample_data, true) do |results, errors|
    pust "Errors: #{errors}"
    results.each do |url, queries|
      puts "Printing results for #{url}"
      queries.each do |query, result|
        puts " Result of query #{query}: #{result}"
      end
    end
  end

Full API reference is available at http://usebobik.com/sdk/

Contributing

Write to support@usebobik.com to become a collaborator.

Bugs?

Submit them here on GitHub: https://github.com/emirkin/bobik_ruby_gem/issues

FAQs

Package last updated on 09 Jul 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.