Giter VIP home page Giter VIP logo

craigler's Introduction

Craigler

Search API for craigslist

Misc Notes:

requires gems ‘hpricot,’ ‘jeweler,’ and ‘ruby-debug.’

My fork address YAML and Hpricot ‘require’ issues.

SYNOPSIS:

I couldn’t decide which API I liked best, so you have two choices.

Craigler.search(:motorcycles, :in => [:utah, :nevada, :arizona], :for => 'Boulevard M50') do |item|
  puts item.title
  puts item.url
  puts item.time
end

or

Craigler.find('Boulevard M50', :in => :california, :only => :motorcycles) do |item|
  puts item.title
  puts item.url
  puts item.time
end

You can also create a search object to fetch the results later. When no location or category is given Craigler searches :all_for_sale_or_wanted :in => :anywhere

search = Craigler::Search.new('Yamaha')
search.results()

Note that additional calls to search.results() will always return the same result set unless refresh is forced

search.results(:refresh => true)

See Craigler::Search for a list of all available options

Supported Categories

:all_for_sale_or_wanted, :art_and_crafts, :auto_parts, :baby_and_kid_stuff, :barter, :bicycles, :boats, :books, :business, :cars_and_trucks, :clothing, :collectibles, :community, :computers_and_tech, :electronics, :event, :farm_and_garden, :free_stuff, :furniture, :games_and_toys, :garage_sales, :general, :gigs, :household, :housing, :items_wanted, :jewelry, :jobs, :materials, :media, :motorcycles, :musical_instruments, :personals, :photo_and_video, :recreational_vehicles, :resume, :services_offered, :sporting_goods, :tickets, :tools

Supported Locations

:alaska, :arizona, :arkansas, :california, :colorado, :connecticut, :delaware, :dc, :florida, :georgia, :hawaii, :idaho, :illinois, :indiana, :iowa, :kansas, :kentucky, :louisiana, :maine, :maryland, :mass, :michigan, :minnesota, :mississippi, :missouri, :montana, :nebraska, :nevada, :n_hampshire, :new_jersey, :new_mexico, :new_york, :n_carolina, :north_dakota, :ohio, :oklahoma, :oregon, :pennsylvania, :rhode_island, :s_carolina, :south_dakota, :tennessee, :texas, :utah, :vermont, :virginia, :washington, :west_virginia :wisconsin, :wyoming

Or use :in => :anywhere to search all supported locations.

REQUIREMENTS:

  • Hpricot

INSTALL:

  • sudo gem install quixoten-craigler

Copyright © 2009 Devin Christensen. See LICENSE for details.

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.