points-scraper 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e51b589e183fe1a37b1685f3d37c2ed701e7f812
4
- data.tar.gz: 84abdcd3af677b07dd834c43f2ae52371417a8e7
3
+ metadata.gz: ae1b4174277f79ef1531333890a8893dbe76f10d
4
+ data.tar.gz: 6c9f4846ae0da550cd7c526a7c16d30005b77984
5
5
  SHA512:
6
- metadata.gz: f97550ddd540712563be49afba253f58b2ef148a40f7dfa467996a300ce6f8fcd6d7fe3475a7b72680788ecac5fc1e238d98f7f16cb5087f0fda2cf8a4947c2f
7
- data.tar.gz: 564c004dd1e382a5ff012a5bf56a784b947adf1656086853887a444cfb2a6e4329f95a988d484f4d74e4af0adf3e83457b00aac0f120e012842b88f7964b0ad6
6
+ metadata.gz: 4d3ed7ef650b85b0b859ab86f159ca56a924ec0e35dba3c25d93bda21c4b820e9517726fb61fddcdaf75a03b1d1f7331c7b6069295fbc412413eaf681a1beb77
7
+ data.tar.gz: b5f0d897b3f2a496cd8d0ebb240d97a6c94d526a6b888ef7d03c37865ac060a4bcd96d74009c1bafcc042df6373f85ce802b02a12e7f3e4fc988b32135561264
@@ -0,0 +1 @@
1
+ strategy: 'bundler'
data/bin/points CHANGED
@@ -16,14 +16,8 @@ module Points::Scraper
16
16
  class App < Thor
17
17
  desc 'tpoint', 'getting current T-POINT from T-SITE.'
18
18
  def tpoint
19
- begin
20
- require 'points-scraper/tpoint'
21
- puts TPoint.new( *auth( 'tsite' ) ).start
22
- rescue Net::OpenTimeout
23
- $stderr.puts 'T-POINT official site has no response, trying Yahoo! JAPAN.'
24
- require 'points-scraper/tpoint-yahoo'
25
- puts TPointYahoo.new( *auth( 'yahoo-japan' ) ).start
26
- end
19
+ require 'points-scraper/tpoint'
20
+ puts TPoint.new( *auth( 'yahoo-japan' ) ).start
27
21
  end
28
22
 
29
23
  desc 'ana', 'getting current ANA Mileage.'
@@ -10,22 +10,25 @@ require 'points-scraper/default'
10
10
 
11
11
  module Points::Scraper
12
12
  class TPoint < Default
13
- URL = 'https://tsite.jp'
14
13
 
15
14
  def start
16
15
  start_scrape do |agent|
17
- agent.open_timeout = 3
16
+ agent.user_agent = 'Mozilla/5.0 (Linux; U; Android 2.3.2; ja-jp; SonyEricssonSO-01C Build/3.0.D.2.79) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'
17
+ agent.get('http://login.yahoo.co.jp/config/login?.lg=jp&.intl=jp&logout=1&.src=www&.done=http://www.yahoo.co.jp')
18
18
 
19
- agent.get( URL + '/tm/pc/login/STKIp0001001.do' )
20
-
21
- agent.page.form_with( :name => 'form1' ) do |form|
22
- form.action = URL + '/tm/pc/login/STKIp0001010.do'
23
- form['LOGIN_ID'] = @user
24
- form['PASSWORD'] = @pass
19
+ sleep 2
20
+ agent.get('https://login.yahoo.co.jp/config/login?.src=www&.done=http://www.yahoo.co.jp')
21
+ agent.page.form_with(name: 'login_form') do |form|
22
+ form.field_with(name: 'login').value = @user
23
+ form.field_with(name: 'passwd').value = @pass
24
+ agent.page.body =~ /\("\.albatross"\)\[0\]\.value = "(.*)"/
25
+ form.field_with(name: '.albatross').value = $1
25
26
  form.click_button
26
27
  end
27
28
 
28
- agent.page.at( 'p.point > span.number' ).text
29
+ sleep 2
30
+ agent.get('http://points.yahoo.co.jp/')
31
+ agent.page.at('.ptsPoint').text
29
32
  end
30
33
  end
31
34
  end
@@ -38,3 +41,4 @@ end
38
41
  # ruby-indent-level: 3
39
42
  # End:
40
43
  # vim: ts=3
44
+
@@ -1,5 +1,5 @@
1
1
  module Points
2
2
  module Scraper
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: points-scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - TADA Tadashi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-17 00:00:00.000000000 Z
12
+ date: 2014-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -64,6 +64,7 @@ extensions: []
64
64
  extra_rdoc_files: []
65
65
  files:
66
66
  - ".gitignore"
67
+ - ".tachikoma.yml"
67
68
  - Gemfile
68
69
  - LICENSE.txt
69
70
  - Rakefile
@@ -72,7 +73,6 @@ files:
72
73
  - lib/points-scraper/anamileage.rb
73
74
  - lib/points-scraper/default.rb
74
75
  - lib/points-scraper/rakuten.rb
75
- - lib/points-scraper/tpoint-yahoo.rb
76
76
  - lib/points-scraper/tpoint.rb
77
77
  - lib/points-scraper/version.rb
78
78
  - misc/_points
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  version: '0'
98
98
  requirements: []
99
99
  rubyforge_project:
100
- rubygems_version: 2.2.2
100
+ rubygems_version: 2.4.1
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: getting mileages/points from shopping web sites.
@@ -1,44 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # tpoint.rb: T-POINT for PointsScraper
4
- #
5
- # Copyright (C) 2012 by TADA Tadashi <t@tdtds.jp>
6
- # Distributed under GPL.
7
- #
8
-
9
- require 'points-scraper/default'
10
-
11
- module Points::Scraper
12
- class TPointYahoo < Default
13
-
14
- def start
15
- start_scrape do |agent|
16
- agent.user_agent = 'Mozilla/5.0 (Linux; U; Android 2.3.2; ja-jp; SonyEricssonSO-01C Build/3.0.D.2.79) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'
17
- agent.get('http://login.yahoo.co.jp/config/login?.lg=jp&.intl=jp&logout=1&.src=www&.done=http://www.yahoo.co.jp')
18
-
19
- sleep 2
20
- agent.get('https://login.yahoo.co.jp/config/login?.src=www&.done=http://www.yahoo.co.jp')
21
- agent.page.form_with(name: 'login_form') do |form|
22
- form.field_with(name: 'login').value = @user
23
- form.field_with(name: 'passwd').value = @pass
24
- agent.page.body =~ /\("\.albatross"\)\[0\]\.value = "(.*)"/
25
- form.field_with(name: '.albatross').value = $1
26
- form.click_button
27
- end
28
-
29
- sleep 2
30
- agent.get('http://points.yahoo.co.jp/')
31
- agent.page.at('.ptsPoint').text
32
- end
33
- end
34
- end
35
- end
36
-
37
- # Local Variables:
38
- # mode: ruby
39
- # indent-tabs-mode: t
40
- # tab-width: 3
41
- # ruby-indent-level: 3
42
- # End:
43
- # vim: ts=3
44
-