points-scraper 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +1 -1
- data/bin/points +8 -2
- data/lib/points-scraper/tpoint-yahoo.rb +44 -0
- data/lib/points-scraper/tpoint.rb +2 -0
- data/lib/points-scraper/version.rb +1 -1
- metadata +31 -23
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0cafca13d00bf026a161199bd355f8fc983d10be
|
4
|
+
data.tar.gz: 003cdda8564a7d16d92836875cde84211a510fa5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e67443fc0757534800797b0cfe75fdc4aed4ba94c7680f531902f4398c824f27e439bc4e4ec660414fa53ee0d71eb3ee48f78339d3795ad5d731d98d33395119
|
7
|
+
data.tar.gz: a5992ffda37c4cffaf7ae940932db8eba21a74d8c51eaa574961d334fe0f035835106159dae308158329920985dd8ec7987515bc8b2c0769d69f063b6d816536
|
data/Gemfile
CHANGED
data/bin/points
CHANGED
@@ -16,8 +16,14 @@ module Points::Scraper
|
|
16
16
|
class App < Thor
|
17
17
|
desc 'tpoint', 'getting current T-POINT from T-SITE.'
|
18
18
|
def tpoint
|
19
|
-
|
20
|
-
|
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
|
21
27
|
end
|
22
28
|
|
23
29
|
desc 'ana', 'getting current ANA Mileage.'
|
@@ -0,0 +1,44 @@
|
|
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
|
+
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: points-scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- TADA Tadashi
|
@@ -10,42 +9,51 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2013-11-15 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: thor
|
17
|
-
requirement:
|
18
|
-
none: false
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - ">="
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '0'
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
|
-
version_requirements:
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
26
28
|
- !ruby/object:Gem::Dependency
|
27
29
|
name: mechanize
|
28
|
-
requirement:
|
29
|
-
none: false
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
|
-
- -
|
32
|
+
- - ">="
|
32
33
|
- !ruby/object:Gem::Version
|
33
34
|
version: '0'
|
34
35
|
type: :runtime
|
35
36
|
prerelease: false
|
36
|
-
version_requirements:
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
37
42
|
- !ruby/object:Gem::Dependency
|
38
43
|
name: pit
|
39
|
-
requirement:
|
40
|
-
none: false
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
41
45
|
requirements:
|
42
|
-
- -
|
46
|
+
- - ">="
|
43
47
|
- !ruby/object:Gem::Version
|
44
48
|
version: '0'
|
45
49
|
type: :runtime
|
46
50
|
prerelease: false
|
47
|
-
version_requirements:
|
48
|
-
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
description: 'getting mileages/points by web scraping shopping sites: T-SITE, ANA
|
49
57
|
and rakuten.'
|
50
58
|
email:
|
51
59
|
- t@tdtds.jp
|
@@ -55,7 +63,7 @@ executables:
|
|
55
63
|
extensions: []
|
56
64
|
extra_rdoc_files: []
|
57
65
|
files:
|
58
|
-
- .gitignore
|
66
|
+
- ".gitignore"
|
59
67
|
- Gemfile
|
60
68
|
- Rakefile
|
61
69
|
- bin/points
|
@@ -63,32 +71,32 @@ files:
|
|
63
71
|
- lib/points-scraper/anamileage.rb
|
64
72
|
- lib/points-scraper/default.rb
|
65
73
|
- lib/points-scraper/rakuten.rb
|
74
|
+
- lib/points-scraper/tpoint-yahoo.rb
|
66
75
|
- lib/points-scraper/tpoint.rb
|
67
76
|
- lib/points-scraper/version.rb
|
68
77
|
- misc/_points
|
69
78
|
- points-scraper.gemspec
|
70
79
|
homepage: https://github.com/tdtds/points-scraper
|
71
80
|
licenses: []
|
81
|
+
metadata: {}
|
72
82
|
post_install_message:
|
73
83
|
rdoc_options: []
|
74
84
|
require_paths:
|
75
85
|
- lib
|
76
86
|
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
87
|
requirements:
|
79
|
-
- -
|
88
|
+
- - ">="
|
80
89
|
- !ruby/object:Gem::Version
|
81
90
|
version: '0'
|
82
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
-
none: false
|
84
92
|
requirements:
|
85
|
-
- -
|
93
|
+
- - ">="
|
86
94
|
- !ruby/object:Gem::Version
|
87
95
|
version: '0'
|
88
96
|
requirements: []
|
89
97
|
rubyforge_project:
|
90
|
-
rubygems_version:
|
98
|
+
rubygems_version: 2.0.3
|
91
99
|
signing_key:
|
92
|
-
specification_version:
|
100
|
+
specification_version: 4
|
93
101
|
summary: getting mileages/points from shopping web sites.
|
94
102
|
test_files: []
|