taaze 0.0.2
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 +7 -0
- data/.gitignore +80 -0
- data/.travis.yml +8 -0
- data/Gemfile +11 -0
- data/LICENSE +22 -0
- data/README.md +23 -0
- data/Rakefile +8 -0
- data/bin/taaze +21 -0
- data/lib/taaze.rb +2 -0
- data/lib/taaze/collections.rb +56 -0
- data/lib/taaze/comments.rb +120 -0
- data/lib/taaze/version.rb +5 -0
- data/spec/collections_spec.rb +32 -0
- data/spec/comments_spec.rb +32 -0
- data/spec/fixures/collections.yml +95 -0
- data/spec/fixures/comments.yml +47 -0
- data/taaze.gemspec +18 -0
- metadata +78 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f555d6b4d0bb1c6438e6531782fda61ec2ce3a39
|
4
|
+
data.tar.gz: 292dd13c591ef9d8652dc72e3a9630e61952d0a7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 651cce08f9a24b349052ba5d2327d2185f24e10300c47e4efdd27969846d181582847ca085a2f45762c20620b7f391a86ab619a1efdfb74d37ff0246e9b51643
|
7
|
+
data.tar.gz: 5e8800660aaee2d7ecb200ee246110c628d2d060704799e8afdfbd40420656725eb38b14d1c01a287305c9df95db6dbad1d4a5504af76bfd2473ead975524e63
|
data/.gitignore
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# Created by https://www.gitignore.io/api/ruby,osx,vim
|
2
|
+
|
3
|
+
### Ruby ###
|
4
|
+
*.gem
|
5
|
+
*.rbc
|
6
|
+
/.config
|
7
|
+
/coverage/
|
8
|
+
/InstalledFiles
|
9
|
+
/pkg/
|
10
|
+
/spec/reports/
|
11
|
+
/spec/examples.txt
|
12
|
+
/test/tmp/
|
13
|
+
/test/version_tmp/
|
14
|
+
/tmp/
|
15
|
+
Gemfile.lock
|
16
|
+
|
17
|
+
## Specific to RubyMotion:
|
18
|
+
.dat*
|
19
|
+
.repl_history
|
20
|
+
build/
|
21
|
+
|
22
|
+
## VCR
|
23
|
+
/spec/fixures/vcr_cassettes
|
24
|
+
|
25
|
+
## Documentation cache and generated files:
|
26
|
+
/.yardoc/
|
27
|
+
/_yardoc/
|
28
|
+
/doc/
|
29
|
+
/rdoc/
|
30
|
+
|
31
|
+
## Environment normalisation:
|
32
|
+
/.bundle/
|
33
|
+
/vendor/bundle
|
34
|
+
/lib/bundler/man/
|
35
|
+
|
36
|
+
# for a library or gem, you might want to ignore these files since the code is
|
37
|
+
# intended to run in multiple environments; otherwise, check them in:
|
38
|
+
# Gemfile.lock
|
39
|
+
# .ruby-version
|
40
|
+
# .ruby-gemset
|
41
|
+
|
42
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
43
|
+
.rvmrc
|
44
|
+
|
45
|
+
|
46
|
+
### OSX ###
|
47
|
+
.DS_Store
|
48
|
+
.AppleDouble
|
49
|
+
.LSOverride
|
50
|
+
|
51
|
+
# Icon must end with two \r
|
52
|
+
Icon
|
53
|
+
|
54
|
+
|
55
|
+
# Thumbnails
|
56
|
+
._*
|
57
|
+
|
58
|
+
# Files that might appear in the root of a volume
|
59
|
+
.DocumentRevisions-V100
|
60
|
+
.fseventsd
|
61
|
+
.Spotlight-V100
|
62
|
+
.TemporaryItems
|
63
|
+
.Trashes
|
64
|
+
.VolumeIcon.icns
|
65
|
+
|
66
|
+
# Directories potentially created on remote AFP share
|
67
|
+
.AppleDB
|
68
|
+
.AppleDesktop
|
69
|
+
Network Trash Folder
|
70
|
+
Temporary Items
|
71
|
+
.apdisk
|
72
|
+
|
73
|
+
|
74
|
+
### Vim ###
|
75
|
+
[._]*.s[a-w][a-z]
|
76
|
+
[._]s[a-w][a-z]
|
77
|
+
*.un~
|
78
|
+
Session.vim
|
79
|
+
.netrwhist
|
80
|
+
*~
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 BUEZE
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# taaze [](https://travis-ci.org/BUEZE/taaze)
|
2
|
+
|
3
|
+
---
|
4
|
+
|
5
|
+
### Usage
|
6
|
+
|
7
|
+
This gem may be used as a command line utility or called from code
|
8
|
+
|
9
|
+
|
10
|
+
### CLI
|
11
|
+
|
12
|
+
`taaze --comments [user_id] --output [file_path]`
|
13
|
+
|
14
|
+
or
|
15
|
+
|
16
|
+
`taaze --collections [user_id] --output [file_path]`
|
17
|
+
|
18
|
+
|
19
|
+
### Example
|
20
|
+
|
21
|
+
`taaze --comments 12522728 --output ./comments.yml`
|
22
|
+
|
23
|
+
`taaze --collections 12522728 --output ./collections.yml`
|
data/Rakefile
ADDED
data/bin/taaze
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
require_relative '../lib/taaze.rb'
|
5
|
+
|
6
|
+
if ARGV.count != 4 || (ARGV[0] != '--comments' && ARGV[0] != '--collections')
|
7
|
+
fail ArgumentError, "Usage: --comments [user_id] --output path OR --collections [user_id] --output path\n"
|
8
|
+
else
|
9
|
+
user_id = ARGV[1]
|
10
|
+
path = ARGV[3]
|
11
|
+
if ARGV[0] == '--comments'
|
12
|
+
comments_found = Taaze::TaazeComments.new(user_id)
|
13
|
+
puts "User #{user_id} has collected #{comments_found.comments.size} comments"
|
14
|
+
File.write(path, comments_found.comments.to_yaml, mode: 'w')
|
15
|
+
else
|
16
|
+
collections_found = Taaze::TaazeCollections.new(user_id)
|
17
|
+
puts "User #{user_id} has collected #{collections_found.collections.size} collections"
|
18
|
+
File.write(path, collections_found.comments.to_yaml, mode: 'w')
|
19
|
+
end
|
20
|
+
puts 'File saved to ' + path
|
21
|
+
end
|
data/lib/taaze.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'open-uri'
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module Taaze
|
6
|
+
# This class get the user personal page as an input
|
7
|
+
# return a hash of user's collections information
|
8
|
+
# For example, with user's url: http://www.taaze.tw/container_zekeaclt_view.html?ci=12522728
|
9
|
+
# here's the user's collections of books: http://www.taaze.tw/container_zekeaclt_view.html?ci=12522728&cp=1
|
10
|
+
# Sampel output (plz remove them after passing the test):
|
11
|
+
# [
|
12
|
+
# {"title"=>"村上收音機", "book_url"=>"http://www.taaze.tw/sing.html?pid=11100635522"}
|
13
|
+
# {"title"=>"尋找漩渦貓的方法", "book_url"=>"http://www.taaze.tw/sing.html?pid=11100210251"}
|
14
|
+
# and so on ...
|
15
|
+
# ]
|
16
|
+
class TaazeCollections
|
17
|
+
USERS_URL = 'http://www.taaze.tw/container_zekeaclt_view.html?ci='
|
18
|
+
API_URL = 'http://www.taaze.tw/beta/zekeacltBooksDataAgent.jsp?custId='
|
19
|
+
BOOK_URL = 'http://www.taaze.tw/sing.html?pid='
|
20
|
+
|
21
|
+
def initialize(user_id)
|
22
|
+
parse_html(user_id)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Return a hash of user's collections
|
26
|
+
def collections
|
27
|
+
@collections ||= extract_books
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
# Parse the html of the url page.
|
33
|
+
def parse_html(user_id)
|
34
|
+
url = API_URL + user_id
|
35
|
+
first_doc = JSON.parse(open(url).read)
|
36
|
+
totalsize = first_doc['totalsize']
|
37
|
+
|
38
|
+
url = API_URL + user_id + '&startNum=0&endNum=' + totalsize.to_s
|
39
|
+
@doc = JSON.parse(open(url).read)['result1']
|
40
|
+
end
|
41
|
+
|
42
|
+
# Return the books in the format specified in spec.
|
43
|
+
def extract_books
|
44
|
+
booklist = []
|
45
|
+
if @doc.count != 0
|
46
|
+
@doc.each do |book_data|
|
47
|
+
book = {}
|
48
|
+
book['title'] = book_data['titleMain']
|
49
|
+
book['book_url'] = BOOK_URL + book_data['prodId']
|
50
|
+
booklist << book
|
51
|
+
end
|
52
|
+
end
|
53
|
+
booklist
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
require 'open-uri'
|
3
|
+
require 'date'
|
4
|
+
require 'json'
|
5
|
+
require 'net/http'
|
6
|
+
|
7
|
+
# Module Taaze
|
8
|
+
module Taaze
|
9
|
+
# This class get the user personal page as an input
|
10
|
+
# return a hash of user's collections information
|
11
|
+
# For example, with user's url: http://www.taaze.tw/container_zekeaclt_view.html?ci=12522728
|
12
|
+
# here's the user's comments of books: http://www.taaze.tw/container_zekeaclt_view.html?ci=12522728&cp=2
|
13
|
+
# Sampel output (plz remove them after passing the test):
|
14
|
+
class TaazeComments
|
15
|
+
USERS_URL = 'http://www.taaze.tw/container_zekeaclt_view.html?ci='
|
16
|
+
MAIN_URL = 'http://www.taaze.tw/container_zekeaclt_view.html?'
|
17
|
+
API_URL = 'http://www.taaze.tw/beta/zekeaCommentDataAgent.jsp?custId='
|
18
|
+
BOOK_URL = 'http://www.taaze.tw/sing.html?pid='
|
19
|
+
|
20
|
+
def initialize(user_id)
|
21
|
+
user_id = numeric?(user_id) ? user_id.to_s : user_id
|
22
|
+
parse_html(user_id)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Return a hash of user's comments
|
26
|
+
def comments
|
27
|
+
@comments_found
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
# Check if it is a integer
|
33
|
+
def numeric?(obj)
|
34
|
+
obj.to_s.match(/\A[+-]?\d+?(\.\d+)?\Z/) == nil? ? false : true
|
35
|
+
end
|
36
|
+
|
37
|
+
# Parse the html of the url page.
|
38
|
+
def split_url(url)
|
39
|
+
str = split_get_last(split_get_last(url, '/'), '?')
|
40
|
+
str = split_get_last(str, '&', -1)
|
41
|
+
str
|
42
|
+
end
|
43
|
+
|
44
|
+
# split string and get last
|
45
|
+
# index for
|
46
|
+
# -1 -> return all array
|
47
|
+
# 0 -> return last obj in array
|
48
|
+
# >=1 -> return obj on array[index]
|
49
|
+
def split_get_last(str_to_split, character, index = 0)
|
50
|
+
arrtmp = str_to_split.split(character)
|
51
|
+
if index == -1
|
52
|
+
arrtmp
|
53
|
+
else
|
54
|
+
index = index == 0 ? arrtmp.length - 1 : index
|
55
|
+
strtmp = arrtmp[index]
|
56
|
+
strtmp
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Parse the html of the url page.
|
61
|
+
def parse_html(user_id)
|
62
|
+
url = API_URL + user_id.to_s + '&startNum=0&endNum=0'
|
63
|
+
# first test and get comments num for the user
|
64
|
+
first_doc = JSON.parse(url_get_html(url))
|
65
|
+
total_num = first_doc['totalsize']
|
66
|
+
|
67
|
+
url = API_URL + user_id.to_s + '&startNum=0&endNum=' + total_num
|
68
|
+
# mainDoc is the all json date for the user's all comment
|
69
|
+
main_doc = JSON.parse(url_get_html(url))
|
70
|
+
extract_comments(main_doc['result1'], user_id)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Send url to get response
|
74
|
+
def url_get_html(url_str)
|
75
|
+
url = URI.parse(URI.encode(url_str)) # first get total size
|
76
|
+
req = Net::HTTP::Get.new(url.to_s)
|
77
|
+
res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
|
78
|
+
res.body
|
79
|
+
end
|
80
|
+
|
81
|
+
# Return the comments in the format specified in spec.
|
82
|
+
def extract_comments(content, user_id)
|
83
|
+
# Json format~
|
84
|
+
# "content":"勇氣就是熱誠,來自於我們對自己工作的自信心;.....",
|
85
|
+
# "title":"",
|
86
|
+
# "status":"C",
|
87
|
+
# "stars":"5",
|
88
|
+
# "prodId":"11100597685",
|
89
|
+
# "titleMain":"行銷之神原一平全集(精裝版)",
|
90
|
+
# "orgProdId":"11100597685",
|
91
|
+
# "pkNo":"1000243977",
|
92
|
+
# "mdf_time":"2015/10/15",
|
93
|
+
# "crt_time":"2015/10/15"
|
94
|
+
#
|
95
|
+
# orgProdId -> bookID -> 11100597685
|
96
|
+
# title -> book title
|
97
|
+
# content -> comment
|
98
|
+
# comment_url
|
99
|
+
# pkNo -> comment ID ->13313301
|
100
|
+
#
|
101
|
+
# http://www.taaze.tw/container_zekeaclt_view.html?co=1000238964&ci=12522728&cp=3
|
102
|
+
# co->comment ci->user
|
103
|
+
data_arr = []
|
104
|
+
if content
|
105
|
+
content.each do |cmtItem|
|
106
|
+
data_hash_sub = Hash.new {}
|
107
|
+
data_hash_sub['title'] = cmtItem['titleMain']
|
108
|
+
data_hash_sub['comment'] = cmtItem['content']
|
109
|
+
data_hash_sub['book_url'] = BOOK_URL + cmtItem['orgProdId']
|
110
|
+
url = MAIN_URL + 'co=' + cmtItem['pkNo'] + '&ci=' + user_id + '&cp=3'
|
111
|
+
data_hash_sub['comment_url'] = url
|
112
|
+
data_arr.push(data_hash_sub)
|
113
|
+
end
|
114
|
+
else
|
115
|
+
data_arr = []
|
116
|
+
end
|
117
|
+
@comments_found ||= data_arr
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'vcr'
|
4
|
+
require 'webmock/minitest'
|
5
|
+
require_relative '../lib/taaze.rb'
|
6
|
+
|
7
|
+
USER_ID = %w(12522728 13193872)
|
8
|
+
collections_from_file = YAML.load(File.read('./spec/fixures/collections.yml'))
|
9
|
+
|
10
|
+
VCR.configure do |config|
|
11
|
+
config.cassette_library_dir = 'spec/fixures/vcr_cassettes'
|
12
|
+
config.hook_into :webmock
|
13
|
+
end
|
14
|
+
|
15
|
+
VCR.use_cassette('collections') do
|
16
|
+
USER_ID.each do |user_id|
|
17
|
+
collections_found = Taaze::TaazeCollections.new(user_id).collections
|
18
|
+
|
19
|
+
describe "Get all the collections with specific user's id" do
|
20
|
+
it 'has the right number of collections' do
|
21
|
+
collections_found.size.must_equal collections_from_file[user_id].size
|
22
|
+
end
|
23
|
+
|
24
|
+
collections_found.map do |book|
|
25
|
+
it 'finds book in the test collection' do
|
26
|
+
exist = collections_from_file[user_id].include? book
|
27
|
+
[book, exist].must_equal [book, true]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'vcr'
|
4
|
+
require 'webmock/minitest'
|
5
|
+
require_relative '../lib/taaze.rb'
|
6
|
+
|
7
|
+
USER_ID = %w(12522728 13193872)
|
8
|
+
comments_from_file = YAML.load(File.read('./spec/fixures/comments.yml'))
|
9
|
+
|
10
|
+
VCR.configure do |config|
|
11
|
+
config.cassette_library_dir = 'spec/fixures/vcr_cassettes'
|
12
|
+
config.hook_into :webmock
|
13
|
+
end
|
14
|
+
|
15
|
+
VCR.use_cassette('comments') do
|
16
|
+
USER_ID.each do |user_id|
|
17
|
+
comments_found = Taaze::TaazeComments.new(user_id).comments
|
18
|
+
|
19
|
+
describe "Get all the comments with specific user's id" do
|
20
|
+
it 'has the right number of comments' do
|
21
|
+
comments_found.size.must_equal comments_from_file[user_id].size
|
22
|
+
end
|
23
|
+
|
24
|
+
comments_found.map do |comment|
|
25
|
+
it 'finds comments in the test comments' do
|
26
|
+
exist = comments_from_file[user_id].include? comment
|
27
|
+
[comment, exist].must_equal [comment, true]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
---
|
2
|
+
'12522728':
|
3
|
+
- title: '村上收音機'
|
4
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100635522'
|
5
|
+
- title: '尋找漩渦貓的方法'
|
6
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100210251'
|
7
|
+
- title: '張愛玲的世界'
|
8
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100030671'
|
9
|
+
- title: '拜訪糖果阿姨'
|
10
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100653796'
|
11
|
+
- title: 'A夢'
|
12
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100732992'
|
13
|
+
- title: '河流'
|
14
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100683568'
|
15
|
+
- title: '紅樓夢校注彩畫本(1-3冊合售)'
|
16
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100161589'
|
17
|
+
- title: '傾城之戀【張愛玲典藏新版】'
|
18
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100228548'
|
19
|
+
- title: '金烏'
|
20
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100677389'
|
21
|
+
- title: '臺灣成長小說選(增訂版)'
|
22
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100649825'
|
23
|
+
- title: '靈魂的領地:國民散文讀本 '
|
24
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100653909'
|
25
|
+
- title: '懸崖上的花園:太平洋戰爭時期上海文學場域(1942-1945)'
|
26
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100672028'
|
27
|
+
- title: '九重葛與美少年'
|
28
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100657709'
|
29
|
+
- title: '春雪:豐饒之海四部曲(1)'
|
30
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100034168'
|
31
|
+
- title: '魯迅小說集'
|
32
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100067679'
|
33
|
+
- title: '波赫士(1-4冊合售合售)'
|
34
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100125593'
|
35
|
+
- title: '奇萊前書'
|
36
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100067730'
|
37
|
+
- title: '半生緣【張愛玲典藏新版】'
|
38
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100192438'
|
39
|
+
- title: '瓊美卡隨想錄(散文)'
|
40
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100616297'
|
41
|
+
- title: '犄角'
|
42
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100617464'
|
43
|
+
- title: '疾病的隱喻 '
|
44
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100625913'
|
45
|
+
- title: '古都'
|
46
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100268249'
|
47
|
+
- title: '觀看的方式'
|
48
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100238376'
|
49
|
+
- title: '臺灣成長小說選'
|
50
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100035125'
|
51
|
+
- title: '晨讀10分鐘:青春無敵早點詩:中學生新詩選'
|
52
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100631660'
|
53
|
+
- title: '屏息的文明'
|
54
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100034203'
|
55
|
+
- title: '雲和'
|
56
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100034334'
|
57
|
+
- title: '海風野火花'
|
58
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100249859'
|
59
|
+
- title: '你的聲音充滿時間'
|
60
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100276696'
|
61
|
+
- title: '離與苦:戰爭的延續'
|
62
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100254818'
|
63
|
+
- title: '少女維特'
|
64
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100241234'
|
65
|
+
- title: '搜索者'
|
66
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100067568'
|
67
|
+
- title: '浮生草'
|
68
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100591888'
|
69
|
+
- title: '溫莎墓園日記(小說)'
|
70
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100617237'
|
71
|
+
- title: '漫長的告別'
|
72
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100210749'
|
73
|
+
- title: '雙月記'
|
74
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100236244'
|
75
|
+
- title: '愛情的盡頭'
|
76
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100210189'
|
77
|
+
- title: '我們在此相遇'
|
78
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100154779'
|
79
|
+
- title: '月球姓氏(聯合文學經典版)'
|
80
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100220368'
|
81
|
+
- title: '小團圓'
|
82
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100192439'
|
83
|
+
- title: '瑪德蓮'
|
84
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100596747'
|
85
|
+
'13193872':
|
86
|
+
- title: '大賣場裡的人類學家:用人文科學搞懂消費者,解決最棘手的商業問題'
|
87
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100707843'
|
88
|
+
- title: '看不見的城市'
|
89
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100175133'
|
90
|
+
- title: '演算法統治世界'
|
91
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100710575'
|
92
|
+
- title: '從0到1:打開世界運作的未知祕密,在意想不到之處發現價值'
|
93
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100720260'
|
94
|
+
- title: '為社會而設計'
|
95
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100713612'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
'12522728':
|
3
|
+
- title: '張愛玲的世界'
|
4
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100030671'
|
5
|
+
comment: '書中所收,尤其是王禎和〈張愛玲在台灣〉一文,珍貴且真摯。'
|
6
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000238964&ci=12522728&cp=3'
|
7
|
+
- title: '小團圓'
|
8
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100192439'
|
9
|
+
comment: '祖奶奶晚期風格,誠實、枯寂又暴烈。'
|
10
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000238963&ci=12522728&cp=3'
|
11
|
+
- title: '村上收音機(3):喜歡吃沙拉的獅子'
|
12
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100644311'
|
13
|
+
comment: '第一集到第三集都很好看,雋永且富於生趣的小品,有如爽口的下酒菜!'
|
14
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000238962&ci=12522728&cp=3'
|
15
|
+
- title: '村上收音機(2):大蕪菁、難挑的酪梨'
|
16
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100635526'
|
17
|
+
comment: '第一集到第三集都很好看,雋永且富於生趣的小品,有如爽口的下酒菜!'
|
18
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000238961&ci=12522728&cp=3'
|
19
|
+
- title: '村上收音機'
|
20
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100635522'
|
21
|
+
comment: '第一集到第三集都很好看,雋永且富於生趣的小品,有如爽口的下酒菜!'
|
22
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000238960&ci=12522728&cp=3'
|
23
|
+
- title: '尋找漩渦貓的方法'
|
24
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100210251'
|
25
|
+
comment: '貓控大叔的異國生活誌,充滿了自以為是的趣味感,十分適合自認為有點怪怪的人(咦)。'
|
26
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000238959&ci=12522728&cp=3'
|
27
|
+
- title: '拜訪糖果阿姨'
|
28
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100653796'
|
29
|
+
comment: '那些終於灰心或終於原諒的情感角落,發出被記憶篩過的,淡而暖的光。'
|
30
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000224332&ci=12522728&cp=3'
|
31
|
+
- title: 'A夢'
|
32
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100732992'
|
33
|
+
comment: '鮮活聯繫新詩小傳統與當代文化,夭矯複雜如深情的孫悟空。'
|
34
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000224330&ci=12522728&cp=3'
|
35
|
+
- title: '河流'
|
36
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100683568'
|
37
|
+
comment: '城市的女漫遊者,寫邊緣,寫冷淡,寫不被看見或被拋擲的。'
|
38
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000224331&ci=12522728&cp=3'
|
39
|
+
- title: '紅樓夢校注彩畫本(1-3冊合售)'
|
40
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100161589'
|
41
|
+
comment: '此書要什麼有什麼,纏綿悱惻有之,狗皮倒灶有之,詩情畫意有之,醜態怪狀有之,不可能有厭煩的時候。'
|
42
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000213998&ci=12522728&cp=3'
|
43
|
+
- title: '傾城之戀【張愛玲典藏新版】'
|
44
|
+
book_url: 'http://www.taaze.tw/sing.html?pid=11100228548'
|
45
|
+
comment: "張愛玲《傾城之戀》(應是舊版《第一爐香》,現已絕版)。最感官化的小說家,最斑斕的視覺,蒙太奇的敘事,張愛玲的「色彩狂」令人在閱讀時總會想像那電影般的畫面。\n"
|
46
|
+
comment_url: 'http://www.taaze.tw/container_zekeaclt_view.html?co=1000211000&ci=12522728&cp=3'
|
47
|
+
'13193872': ''
|
data/taaze.gemspec
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
2
|
+
require 'taaze/version'
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'taaze'
|
6
|
+
s.version = Taaze::VERSION
|
7
|
+
s.executables << 'taaze'
|
8
|
+
s.add_development_dependency 'nokogiri'
|
9
|
+
s.date = Taaze::DATE
|
10
|
+
s.summary = 'Data extractor of Taaze'
|
11
|
+
s.description = 'Get the book comments or collections of specific user.'
|
12
|
+
s.authors = ['Bueze']
|
13
|
+
s.email = ''
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.homepage = 'https://github.com/BUEZE/taaze'
|
17
|
+
s.license = 'MIT'
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: taaze
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bueze
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-18 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: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Get the book comments or collections of specific user.
|
28
|
+
email: ''
|
29
|
+
executables:
|
30
|
+
- taaze
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- ".travis.yml"
|
36
|
+
- Gemfile
|
37
|
+
- LICENSE
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- bin/taaze
|
41
|
+
- lib/taaze.rb
|
42
|
+
- lib/taaze/collections.rb
|
43
|
+
- lib/taaze/comments.rb
|
44
|
+
- lib/taaze/version.rb
|
45
|
+
- spec/collections_spec.rb
|
46
|
+
- spec/comments_spec.rb
|
47
|
+
- spec/fixures/collections.yml
|
48
|
+
- spec/fixures/comments.yml
|
49
|
+
- taaze.gemspec
|
50
|
+
homepage: https://github.com/BUEZE/taaze
|
51
|
+
licenses:
|
52
|
+
- MIT
|
53
|
+
metadata: {}
|
54
|
+
post_install_message:
|
55
|
+
rdoc_options: []
|
56
|
+
require_paths:
|
57
|
+
- lib
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements: []
|
69
|
+
rubyforge_project:
|
70
|
+
rubygems_version: 2.5.0
|
71
|
+
signing_key:
|
72
|
+
specification_version: 4
|
73
|
+
summary: Data extractor of Taaze
|
74
|
+
test_files:
|
75
|
+
- spec/collections_spec.rb
|
76
|
+
- spec/comments_spec.rb
|
77
|
+
- spec/fixures/collections.yml
|
78
|
+
- spec/fixures/comments.yml
|