PhantomJS driver for the google_ajax_crawler gem: Rack Middleware adhering to the Google Ajax Crawling Scheme, using a headless browser to render JS heavy pages and serve a dom snapshot of the rendered state to a requesting search engine.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml try to fix travis Jun 13, 2013
Gemfile
LICENSE.txt
README.md
Rakefile
google_ajax_crawler_phantomjs.gemspec

README.md

GoogleAjaxCrawlerPhantomjs

Build Status

PhantomJS driver for the google_ajax_crawler gem: Rack Middleware adhering to the Google Ajax Crawling Scheme, using a headless browser to render JS heavy pages and serve a dom snapshot of the rendered state to a requesting search engine.

for more information check : https://github.com/benkitzelman/google-ajax-crawler

Installation

Install:

$ gem install google_ajax_crawler_phantomjs

Usage

In your config.ru

require 'google_ajax_crawler'

use GoogleAjaxCrawler::Crawler do |config|
  config.page_loaded_test = lambda {|driver| driver.page.evaluate_script('document.getElementById("loading") == null') }
  config.driver = GoogleAjaxCrawler::Drivers::Poltergeist
end

app = lambda {|env| [200, {'Content-Type' => 'text/plain'}, "b" ] }
run app

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request