points-scraper 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +6 -0
- data/Rakefile +1 -0
- data/bin/points-tpoint +40 -0
- data/lib/points-scraper.rb +7 -0
- data/lib/points-scraper/version.rb +5 -0
- data/points-scraper.gemspec +25 -0
- metadata +75 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/points-tpoint
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# tsite.rb: getting current T-Point by scraping tsite.jp.
|
4
|
+
#
|
5
|
+
# Copyright (C) 2011 by TADA Tadashi <t@tdtds.jp>
|
6
|
+
# Distributed under GPL.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'rubygems'
|
10
|
+
require 'mechanize'
|
11
|
+
require 'pit'
|
12
|
+
|
13
|
+
URL = 'https://tsite.jp'
|
14
|
+
|
15
|
+
@login = Pit::get( 'tsite', :require => {
|
16
|
+
'user' => 'your ID of tsite.jp.',
|
17
|
+
'pass' => 'your Password of tsite.jp.'
|
18
|
+
} )
|
19
|
+
|
20
|
+
agent = Mechanize::new
|
21
|
+
agent.set_proxy( *ENV['HTTP_PROXY'].split( /:/ ) ) if ENV['HTTP_PROXY']
|
22
|
+
|
23
|
+
agent.get( URL + '/tm/pc/login/STKIp0001001.do' )
|
24
|
+
|
25
|
+
agent.page.form_with( :name => 'form1' ) do |form|
|
26
|
+
form.action = URL + '/tm/pc/login/STKIp0001010.do'
|
27
|
+
form['LOGIN_ID'] = @login['user']
|
28
|
+
form['PASSWORD'] = @login['pass']
|
29
|
+
form.click_button
|
30
|
+
end
|
31
|
+
|
32
|
+
puts agent.page.at( 'p.point > span.number' ).text
|
33
|
+
|
34
|
+
# Local Variables:
|
35
|
+
# mode: ruby
|
36
|
+
# indent-tabs-mode: t
|
37
|
+
# tab-width: 3
|
38
|
+
# ruby-indent-level: 3
|
39
|
+
# End:
|
40
|
+
# vim: ts=3
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "points-scraper/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "points-scraper"
|
7
|
+
s.version = Points::Scraper::VERSION
|
8
|
+
s.authors = ["TADA Tadashi"]
|
9
|
+
s.email = ["t@tdtds.jp"]
|
10
|
+
s.homepage = "https://github.com/tdtds/points-scraper"
|
11
|
+
s.summary = "getting mileages/points from shopping web sites."
|
12
|
+
s.description = "getting mileages/points by web scraping shopping sites: T-SITE."
|
13
|
+
|
14
|
+
s.rubyforge_project = "points-scraper"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
# s.add_development_dependency "rspec"
|
23
|
+
s.add_runtime_dependency "mechanize"
|
24
|
+
s.add_runtime_dependency "pit"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: points-scraper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- TADA Tadashi
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-02-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: mechanize
|
16
|
+
requirement: &72358050 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *72358050
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: pit
|
27
|
+
requirement: &72357840 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *72357840
|
36
|
+
description: ! 'getting mileages/points by web scraping shopping sites: T-SITE.'
|
37
|
+
email:
|
38
|
+
- t@tdtds.jp
|
39
|
+
executables:
|
40
|
+
- points-tpoint
|
41
|
+
extensions: []
|
42
|
+
extra_rdoc_files: []
|
43
|
+
files:
|
44
|
+
- .gitignore
|
45
|
+
- Gemfile
|
46
|
+
- Rakefile
|
47
|
+
- bin/points-tpoint
|
48
|
+
- lib/points-scraper.rb
|
49
|
+
- lib/points-scraper/version.rb
|
50
|
+
- points-scraper.gemspec
|
51
|
+
homepage: https://github.com/tdtds/points-scraper
|
52
|
+
licenses: []
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
requirements: []
|
70
|
+
rubyforge_project: points-scraper
|
71
|
+
rubygems_version: 1.8.11
|
72
|
+
signing_key:
|
73
|
+
specification_version: 3
|
74
|
+
summary: getting mileages/points from shopping web sites.
|
75
|
+
test_files: []
|