giropay_stalker 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a77aded194bd38e4986524ba0e7b16f8c82edd99
4
+ data.tar.gz: 9ab61013bdecd1ad6a96e131f672dfbb39e0a001
5
+ SHA512:
6
+ metadata.gz: 0445fe11aa860208703ae4c9cffe63109df090c8ff4b6d3b04b418c6c0ec1fbc8a467f06ba83417f82806c4424f6d98481d40bdbb740e25c2704f11652862415
7
+ data.tar.gz: 86597b4e466556691c694e8fe6d4bd736ff6ca5e14feef0e80de11d43450aca61b08ee036704e23bfae48dde75aaf55d0629d26d98b869e3df9f6235bbade8ee
data/README.md CHANGED
@@ -10,9 +10,9 @@ Stalks Giropay to find out if a bank supports Giropay
10
10
 
11
11
  gp = GiropayStalker::Scraper.new
12
12
 
13
- gp.supports(70070024)
13
+ gp.supported?(70070024)
14
14
  => false
15
15
 
16
- gp.supports(37050198)
16
+ gp.supported?(37050198)
17
17
  => true
18
18
 
data/Rakefile CHANGED
@@ -1,2 +1 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
1
+ require "bundler/gem_tasks"
@@ -11,10 +11,11 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "https://github.com/railslove/giropay_stalker"
12
12
  s.summary = %q{Allows you to easily test a german bank code number for griopay support}
13
13
  s.description = %q{Allows you to easily test a german bank code number for griopay support}
14
-
15
- s.add_dependency "mechanize", "~> 1.0.0"
16
-
17
- s.rubyforge_project = "giropay_stalker"
14
+
15
+ s.add_dependency "nokogiri"
16
+ s.add_dependency "httparty"
17
+
18
+ s.add_development_dependency "rake"
18
19
 
19
20
  s.files = `git ls-files`.split("\n")
20
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -1,7 +1,8 @@
1
1
  $:.unshift(File.expand_path("../", __FILE__))
2
2
 
3
3
  # Gems
4
- require "mechanize"
4
+ require "nokogiri"
5
+ require "httparty"
5
6
 
6
7
  # Local files
7
8
  require "giropay_stalker/scraper"
@@ -1,28 +1,10 @@
1
1
  module GiropayStalker
2
2
  class Scraper
3
-
4
- def supported?(bank_code)
5
- page = agent.get("http://www.giropay.de/index.php?id=banken_check")
6
- blz_form = page.form("searchform")
7
3
 
8
- # paste the bank code into the form
9
- blz_form.fields[0].value = bank_code
4
+ def supported?(bank_code)
5
+ page = Nokogiri::HTML(HTTParty.post("http://www.giropay.de/fuer-kaeufer/giropay-fuer-kaeufer/banken-check.html", :body => {"tx_sfbankencheck_pi1[bank_search][sword]" => bank_code}))
10
6
 
11
- # we have to reset the form action explicit to the url, empty action tag won't work
12
- blz_form.action = "http://www.giropay.de/index.php?id=banken_check"
13
-
14
- page = blz_form.click_button
15
-
16
- # check if the giropay logo is present
17
- page.search(".//img[@src='typo3conf/ext/sf_giropay_contact/pi5/gplogo.gif']").any?
18
- end
19
-
20
- def log
21
- @log ||= Logger.now
22
- end
23
-
24
- def agent
25
- @agent ||= Mechanize.new
7
+ page.xpath('//*[text()="nimmt an giropay teil"]').any?
26
8
  end
27
9
  end
28
10
  end
@@ -1,3 +1,3 @@
1
1
  module GiropayStalker
2
- VERSION = "0.0.1"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,49 +1,64 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: giropay_stalker
3
- version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 1
10
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Lars Brillert
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2011-05-13 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: mechanize
11
+ date: 2014-10-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nokogiri
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
23
21
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 23
30
- segments:
31
- - 1
32
- - 0
33
- - 0
34
- version: 1.0.0
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: httparty
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
35
34
  type: :runtime
36
- version_requirements: *id001
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
37
55
  description: Allows you to easily test a german bank code number for griopay support
38
- email:
56
+ email:
39
57
  - lars@railslove.com
40
58
  executables: []
41
-
42
59
  extensions: []
43
-
44
60
  extra_rdoc_files: []
45
-
46
- files:
61
+ files:
47
62
  - .gitignore
48
63
  - Gemfile
49
64
  - README.md
@@ -52,39 +67,27 @@ files:
52
67
  - lib/giropay_stalker.rb
53
68
  - lib/giropay_stalker/scraper.rb
54
69
  - lib/giropay_stalker/version.rb
55
- has_rdoc: true
56
70
  homepage: https://github.com/railslove/giropay_stalker
57
71
  licenses: []
58
-
72
+ metadata: {}
59
73
  post_install_message:
60
74
  rdoc_options: []
61
-
62
- require_paths:
75
+ require_paths:
63
76
  - lib
64
- required_ruby_version: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
- version: "0"
73
- required_rubygems_version: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- hash: 3
79
- segments:
80
- - 0
81
- version: "0"
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
82
87
  requirements: []
83
-
84
- rubyforge_project: giropay_stalker
85
- rubygems_version: 1.4.1
88
+ rubyforge_project:
89
+ rubygems_version: 2.2.2
86
90
  signing_key:
87
- specification_version: 3
91
+ specification_version: 4
88
92
  summary: Allows you to easily test a german bank code number for griopay support
89
93
  test_files: []
90
-