google_ajax_crawler 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +10 -0
- data/examples/{config.ru → capybara_webkit.ru} +0 -2
- data/google_ajax_crawler.gemspec +2 -1
- data/lib/google_ajax_crawler.rb +12 -13
- data/releases/google_ajax_crawler-0.1.1.gem +0 -0
- data/spec/support/page.html +2 -1
- metadata +3 -3
- data/.document +0 -5
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzMwMTEyOWEwMzg3OWNiMTE1MzU1NzdjNDdkZGE5ZDE1YzNiMDk5NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGNkNzYyMDg4ZWZjMmRjMDJhM2JiMmE2NTg0MTkyOWY2MDRmMWYyMg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGEyYTY5MWQwYzhkY2NiNjlmZWFmM2JiMjYwY2ZkNDQ0M2VmMjM2ZTMyNzhl
|
10
|
+
NjFjNmRkYWE2M2JkMjhhYTZjZmIyY2RkMzI2MzQ5NGNjOGQ5NWUyOTdjMDg3
|
11
|
+
OTAzNDE3NDgwYTAyMWM1ZDgzMGM0YWZlYTIwMzBiNTk5M2VjMGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDc1ODY4MTI2YzRhNTNiNmQ2YzcwNjliMjA2NTFmMzczM2ZmYmI0NzQxNzI1
|
14
|
+
NGVlODA0NjQ4YmQ4ZmIwYTNkZGZlYzQzNmMwNDNhYjhmOTgyM2NkMjQ5N2Ew
|
15
|
+
YzRmNTU2ZDRhYTE2MWRkNjk0MTg1OTU2OTM2MzY5ODA5ODIwMDM=
|
data/README.md
CHANGED
@@ -26,6 +26,16 @@ run app
|
|
26
26
|
|
27
27
|
```
|
28
28
|
|
29
|
+
## Examples
|
30
|
+
|
31
|
+
In the examples folder, each driver has a rackup file, which can be launched:
|
32
|
+
|
33
|
+
`rackup examples/[driver_name].ru`
|
34
|
+
|
35
|
+
then open a browser to http://localhost:9292/#!test and view source.... This is how a search engine will see your page. *NOTE:* don't look at the markup through a web inspector as it will most likely display dom elements rendered on the fly by js.
|
36
|
+
|
37
|
+
Change the url to http://localhost:9292/?_escaped_fragment_=test , and then again view source to see how the DOM state has been captured
|
38
|
+
|
29
39
|
## Configuration Options
|
30
40
|
|
31
41
|
### page_loaded_test
|
data/google_ajax_crawler.gemspec
CHANGED
data/lib/google_ajax_crawler.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
require 'rack/utils'
|
2
|
-
require 'uri'
|
3
|
-
|
4
|
-
base_path = './lib/google_ajax_crawler'
|
5
|
-
|
6
|
-
require "#{base_path}/drivers/driver"
|
7
|
-
[base_path, "#{base_path}/drivers"].each do |folder|
|
8
|
-
Dir["#{folder}/*.rb"].each {|file| require file }
|
9
|
-
end
|
10
|
-
|
11
1
|
module GoogleAjaxCrawler
|
12
|
-
|
13
|
-
|
2
|
+
class << self
|
3
|
+
def version
|
4
|
+
"0.1.2"
|
5
|
+
end
|
14
6
|
end
|
15
|
-
end
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'uri'
|
10
|
+
require 'google_ajax_crawler/crawler'
|
11
|
+
require 'google_ajax_crawler/options'
|
12
|
+
require 'google_ajax_crawler/page'
|
13
|
+
require 'google_ajax_crawler/drivers/driver'
|
14
|
+
require 'google_ajax_crawler/drivers/capybara_webkit'
|
Binary file
|
data/spec/support/page.html
CHANGED
@@ -11,10 +11,11 @@
|
|
11
11
|
var writeHash = function() {
|
12
12
|
document.getElementById('page_state').innerHTML = "Javascript rendering complete for client-side route " + document.location.hash;
|
13
13
|
var loadingMask = document.getElementById('loading');
|
14
|
-
loadingMask.parentNode.removeChild(loadingMask);
|
14
|
+
if(loadingMask) loadingMask.parentNode.removeChild(loadingMask);
|
15
15
|
console.log('done...');
|
16
16
|
};
|
17
17
|
|
18
|
+
window.addEventListener("hashchange", writeHash, false);
|
18
19
|
setTimeout(writeHash, 500);
|
19
20
|
};
|
20
21
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_ajax_crawler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Kitzelman
|
@@ -47,7 +47,6 @@ executables: []
|
|
47
47
|
extensions: []
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
|
-
- .document
|
51
50
|
- .gitignore
|
52
51
|
- .rspec
|
53
52
|
- Gemfile
|
@@ -55,7 +54,7 @@ files:
|
|
55
54
|
- LICENSE.txt
|
56
55
|
- README.md
|
57
56
|
- Rakefile
|
58
|
-
- examples/
|
57
|
+
- examples/capybara_webkit.ru
|
59
58
|
- google_ajax_crawler.gemspec
|
60
59
|
- lib/google_ajax_crawler.rb
|
61
60
|
- lib/google_ajax_crawler/crawler.rb
|
@@ -64,6 +63,7 @@ files:
|
|
64
63
|
- lib/google_ajax_crawler/options.rb
|
65
64
|
- lib/google_ajax_crawler/page.rb
|
66
65
|
- releases/google_ajax_crawler-0.1.0.gem
|
66
|
+
- releases/google_ajax_crawler-0.1.1.gem
|
67
67
|
- spec/integration/capybara_webkit_spec.rb
|
68
68
|
- spec/spec_helper.rb
|
69
69
|
- spec/support/page.html
|