Giter Club home page Giter Club logo

ypscaper's Introduction

Yellow Page Scraper is a library for searching various online yellow pages
providers such as switchboard.com and superpages.com.

The search method returns an array of results or an empty list.  The minimum
required arguments are keyword, city, and state (passed in that order).  The
rest of the arguments should be passed as has options 

  :provider => :switchboard
  :num_results => 10
  :num_results => :all

Currently only supports switchboard fully.  Superpages (:superpages) and
yellowpages.com (:yellowpages) are on the way.

Each result has at least the name set.  Anything missing will be set to nil.
Here is the entire list of possible data found (accessed via result.<data name>):

  url - website (often not found or some search url for the provider)
  name - business name or person's name
  phone - main phone number (sometimes they have additional numbers.  currently not getting those)
  address - main address
  city
  state
  zip - usually not there
  email
  provider - which provider was used to find the data

== Usage

    require 'ypscraper'
    yp = YPScraper.new(:switchboard)

    # See how many entires are on the first page
    print "Number of results for first page when searching dentist in austin, tx is " + 
      yp.search("dentist", "austin", "tx").size.to_s
    puts

    # Get 1st 3 yellow page entries
    results = yp.search("dentist", "austin", "tx" , :num_results=>3)
    results.each_with_index do |r,i|
      puts "#{i} - #{r.name} / #{r.url} / #{r.address} / #{r.url}"
    end


    # Get all entries for a search
    results = yp.search("Periodontics Dentists", "austin", "tx" , :num_results=>:all)
    results.each_with_index do |r,i|
      puts "#{i} - #{r.name} / #{r.url} / #{r.address} / #{r.url}"
    end

== License

Copyright (c) 2009 Taylor Carpenter <[email protected]>

You may use, copy and redistribute this library under the same terms as
{Ruby itself}[http://www.ruby-lang.org/en/LICENSE.txt] or under the 
{MIT license}[http://mocha.rubyforge.org/files/MIT-LICENSE.html].

ypscaper's People

Contributors

taylor avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.