scrapify 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## ScrApify
2
2
 
3
- ScrApify is a library to build APIs by scraping static sites with an ActiveRecord like querying interface
3
+ ScrApify is a library to build APIs by scraping static sites and use data as models or JSON APIs
4
4
 
5
5
  ### Installation
6
6
 
@@ -38,4 +38,31 @@ Now you can use finder methods to extract data from a static site
38
38
  > Pizza.last
39
39
 
40
40
  > Pizza.count
41
- ```
41
+ ```
42
+
43
+ ### JSON API (Rack application example)
44
+
45
+ Scrapify comes with a Rack application called Jsonify which can expose scraped models as JSON.
46
+
47
+ Check out this [Rack application example](https://github.com/sathish316/jsonify_rack_example) for more details:
48
+
49
+ https://github.com/sathish316/jsonify_rack_example
50
+
51
+ In your Rack application map the routes you want to expose as JSON using Rack::Builder#map
52
+
53
+ ```
54
+ map '/pizzas' do
55
+ run Jsonify.new('/pizzas', ::Pizza)
56
+ end
57
+ ```
58
+
59
+ This will respond to two urls index and show with JSON:
60
+
61
+ * /pizzas
62
+ * /pizzas/:id
63
+
64
+ Jsonify currently has a limitation where the URLs /pizzas.json and /pizzas/1.json cannot be matched by the same map entry in Rack routes
65
+
66
+ ### JSON API (Rails application example)
67
+
68
+ TODO
@@ -1,3 +1,3 @@
1
1
  module Scrapify
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/scrapify.gemspec CHANGED
@@ -22,5 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "rspec"
23
23
  s.add_development_dependency "mocha"
24
24
  s.add_development_dependency "fakeweb"
25
- # s.add_runtime_dependency "nokogiri"
25
+ s.add_runtime_dependency "nokogiri"
26
+ s.add_runtime_dependency "active_support"
27
+ s.add_runtime_dependency "json"
26
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrapify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70197239201780 !ruby/object:Gem::Requirement
16
+ requirement: &70259781595320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70197239201780
24
+ version_requirements: *70259781595320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mocha
27
- requirement: &70197239181000 !ruby/object:Gem::Requirement
27
+ requirement: &70259781594420 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70197239181000
35
+ version_requirements: *70259781594420
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: fakeweb
38
- requirement: &70197239178500 !ruby/object:Gem::Requirement
38
+ requirement: &70259781593260 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,40 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70197239178500
46
+ version_requirements: *70259781593260
47
+ - !ruby/object:Gem::Dependency
48
+ name: nokogiri
49
+ requirement: &70259781592380 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *70259781592380
58
+ - !ruby/object:Gem::Dependency
59
+ name: active_support
60
+ requirement: &70259781591080 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: *70259781591080
69
+ - !ruby/object:Gem::Dependency
70
+ name: json
71
+ requirement: &70259781586320 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: *70259781586320
47
80
  description: ScrApify scraps static html sites to RESTlike APIs
48
81
  email:
49
82
  - sathish316@gmail.com