points-scraper 0.1.3 → 0.1.4
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 +4 -4
- data/.tachikoma.yml +1 -0
- data/bin/points +2 -8
- data/lib/points-scraper/tpoint.rb +13 -9
- data/lib/points-scraper/version.rb +1 -1
- metadata +4 -4
- data/lib/points-scraper/tpoint-yahoo.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae1b4174277f79ef1531333890a8893dbe76f10d
|
4
|
+
data.tar.gz: 6c9f4846ae0da550cd7c526a7c16d30005b77984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d3ed7ef650b85b0b859ab86f159ca56a924ec0e35dba3c25d93bda21c4b820e9517726fb61fddcdaf75a03b1d1f7331c7b6069295fbc412413eaf681a1beb77
|
7
|
+
data.tar.gz: b5f0d897b3f2a496cd8d0ebb240d97a6c94d526a6b888ef7d03c37865ac060a4bcd96d74009c1bafcc042df6373f85ce802b02a12e7f3e4fc988b32135561264
|
data/.tachikoma.yml
ADDED
@@ -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
|
-
|
20
|
-
|
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.
|
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
|
-
|
20
|
-
|
21
|
-
agent.page.form_with(
|
22
|
-
form.
|
23
|
-
form
|
24
|
-
|
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
|
-
|
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
|
+
|
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.
|
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-
|
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.
|
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
|
-
|