Skip to content

Commit

Permalink
Added APIdock finder
Browse files Browse the repository at this point in the history
  • Loading branch information
fcoury committed May 7, 2009
1 parent ef26d6a commit ecd1d97
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/f/finder/apidock.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
F::Finder.define :apidock do
description 'APIdock search'
base_uri 'http://apidock.com/'
find { |http, o| http.get '/rails/search', :query => o[:terms], :hl => 'en' }

parse do |page, result|
require 'pp'
puts "[#{page.css('#docs_container #main_body h2').public_methods.pretty_inspect}]"

result.header = page.css('#docs_container #main_body h2').inner_html
result.previous_url = page.css('#main_body div.pagination a.prev_page')
result.next_url = page.css('#main_body div.pagination a.next_page')
result.items = page.css('#main_body .result .result_title h3 a')
end
end

0 comments on commit ecd1d97

Please sign in to comment.