Search API for craigslist
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 the results are cached until you instruct craigler to update them.
search.results(:refresh => true)
See {Craigler.Search} for a list of all available options
: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
Use :anywhere
to search all 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
:auburn
, :bham
, :columbusga
, :dothan
, :shoals
, :gadsden
, :huntsville
, :mobile
, :montgomery
, :tuscaloosa
:anchorage
:flagstaff
, :mohave
, :phoenix
, :prescott
, :sierravista
, :tucson
, :yuma
:fayar
, :fortsmith
, :jonesboro
, :littlerock
, :memphis
, :texarkana
:sfbay
, :bakersfield
, :chico
, :fresno
, :goldcountry
, :humboldt
, :imperial
, :inlandempire
:losangeles
, :mendocino
, :merced
, :modesto
, :monterey
, :orangecounty
, :palmsprings
, :redding
:reno
, :sacramento
, :sandiego
, :slo
, :santabarbara
, :stockton
, :ventura
, :visalia
, :yubasutter
:boulder
, :cosprings
, :denver
, :fortcollins
, :pueblo
, :rockies
, :westslope
:newlondon
, :hartford
, :newhaven
, :nwct
:delaware
:washingtondc
:daytona
, :keys
, :fortmyers
, :gainesville
, :jacksonville
, :lakeland
, :ocala
, :orlando
:panamacity
, :pensacola
, :sarasota
, :miami
, :spacecoast
, :staugustine
, :tallahassee
, :tampa
, :treasure
:athensga
, :atlanta
, :augusta
, :brunswick
, :columbusga
, :macon
, :savannah
, :valdosta
:honolulu
:boise
, :eastidaho
, :pullman
, :spokane
, :twinfalls
:bn
, :carbondale
, :chambana
, :chicago
, :decatur
, :peoria
, :quadcities
, :rockford
, :springfieldil
, :stlouis
:bloomington
, :evansville
, :fortwayne
, :indianapolis
, :tippecanoe
, :muncie
, :southbend
, :terrehaute
:ames
, :cedarrapids
, :desmoines
, :dubuque
, :iowacity
, :omaha
, :quadcities
, :siouxcity
, :waterloo
:kansascity
, :lawrence
, :ksu
, :topeka
, :wichita
:bgky
, :cincinnati
, :huntington
, :lexington
, :louisville
, :westky
:batonrouge
, :lafayette
, :lakecharles
, :monroe
, :neworleans
, :shreveport
:maine
:annapolis
, :baltimore
, :easternshore
, :smd
, :westmd
:boston
, :capecod
, :southcoast
, :westernmass
, :worcester
:annarbor
, :centralmich
, :detroit
, :flint
, :grandrapids
, :jxn
, :kalamazoo
, :lansing
:muskegon
, :nmi
, :porthuron
, :saginaw
, :southbend
, :swmi
, :up
:duluth
, :fargo
, :mankato
, :minneapolis
, :rmn
, :stcloud
:gulfport
, :hattiesburg
, :jackson
, :memphis
, :northmiss
:columbiamo
, :joplin
, :kansascity
, :semo
, :springfield
, :stlouis
:montana
:grandisland
, :lincoln
, :omaha
, :siouxcity
:lasvegas
, :reno
:nh
:cnj
, :jerseyshore
, :newjersey
, :southjersey
:albuquerque
, :farmington
, :lascruces
, :roswell
, :santafe
:albany
, :binghamton
, :buffalo
, :catskills
, :chautauqua
, :elmira
, :hudsonvalley
, :ithaca
:longisland
, :newyork
, :plattsburgh
, :rochester
, :syracuse
, :utica
, :watertown
:asheville
, :boone
, :charlotte
, :eastnc
, :fayetteville
, :greensboro
, :hickory
, :outerbanks
:raleigh
, :wilmington
, :winstonsalem
:fargo
, :nd
:akroncanton
, :athensohio
, :cincinnati
, :cleveland
, :columbus
, :dayton
, :huntington
, :limaohio
:mansfield
, :parkersburg
, :sandusky
, :toledo
, :wheeling
, :youngstown
:fortsmith
, :lawton
, :oklahomacity
, :stillwater
, :tulsa
:bend
, :corvallis
, :eastoregon
, :eugene
, :medford
, :oregoncoast
, :portland
, :roseburg
, :salem
:altoona
, :erie
, :harrisburg
, :lancaster
, :allentown
, :philadelphia
, :pittsburgh
, :poconos
:reading
, :scranton
, :pennstate
, :williamsport
, :york
:providence
:charleston
, :columbia
, :florencesc
, :greenville
, :hiltonhead
, :myrtlebeach
:sd
:chattanooga
, :clarksville
, :jacksontn
, :knoxville
, :memphis
, :nashville
, :tricities
:abilene
, :amarillo
, :austin
, :beaumont
, :brownsville
, :collegestation
, :corpuschristi
, :dallas
:elpaso
, :galveston
, :houston
, :killeen
, :laredo
, :lubbock
, :mcallen
, :odessa
, :sanantonio
:sanmarcos
, :texarkana
, :easttexas
, :victoriatx
, :waco
, :wichitafalls
:logan
, :ogden
, :provo
, :saltlakecity
, :stgeorge
:burlington
:blacksburg
, :charlottesville
, :danville
, :easternshore
, :fredericksburg
, :norfolk
, :harrisonburg
:lynchburg
, :richmond
, :roanoke
:bellingham
, :kpr
, :olympic
, :pullman
, :seattle
, :skagit
, :spokane
, :wenatchee
, :yakima
:charlestonwv
, :huntington
, :martinsburg
, :morgantown
, :parkersburg
, :wv
, :wheeling
:appleton
, :duluth
, :eauclaire
, :greenbay
, :janesville
, :racine
, :lacrosse
, :madison
:milwaukee
, :sheboygan
, :wausau
- Hpricot
- sudo gem install craigler
Copyright (c) 2009 Devin Christensen. See {file:LICENSE} for details.