kindle manager
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
<br>
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
## CHANGE LOG
|
||||
[ChangeLog](changelog.md) 这里记录迭代过程,及过程中记录的一些功能的想法,
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
backup/x.bk.info.data.bk
Normal file
1
backup/x.bk.info.data.bk
Normal file
File diff suppressed because one or more lines are too long
BIN
design/mainwindow1.png
Normal file
BIN
design/mainwindow1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 281 KiB |
BIN
design/mainwindow2.png
Normal file
BIN
design/mainwindow2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 286 KiB |
BIN
downimg/p2233249734.jpg
Normal file
BIN
downimg/p2233249734.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
downimg/s29452451.jpg
Normal file
BIN
downimg/s29452451.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -43,10 +43,11 @@ infos_temp = """<table border="0">
|
||||
<font size="4" color="black"></font><br>
|
||||
<a href={link}><font size="8" color="darkred">{bookname}</font></a><br><br>
|
||||
<font size="4" color="black">作者 : {author}</font><br><br>
|
||||
<font size="4" color="yellow">评论数 : {ratenum}</font> <br><br>
|
||||
<font size="4" color=#31849B>评论数 : {ratenum}</font> <br><br>
|
||||
<font size="4" color="black">评分 : {score}</font> <br><br>
|
||||
<font size="4" color="green">出版社 : {publisher}</font><br><br>
|
||||
<font size="4">出版时间 : {publishing}</font> <br><br>
|
||||
<font size="4" color=#31849B>内容简介 : {description}</font> <br><br>
|
||||
</td>
|
||||
<td style="border-left:1px solid lightgray;"> </td>
|
||||
<td width=100> </td>
|
||||
@@ -263,6 +264,7 @@ class kmanWindow(QMainWindow):
|
||||
"ratenum": "893",
|
||||
"publisher": "中信出版社",
|
||||
"publishing": "2014",
|
||||
"description": "xxx",
|
||||
"author": "【美】伯南克/巴曙松"
|
||||
}
|
||||
'''
|
||||
@@ -278,7 +280,8 @@ class kmanWindow(QMainWindow):
|
||||
self.ui.textEdit.setHtml(infos_temp.format(link=vv['link'],bookname=vv['bookname'],
|
||||
author=vv['author'], ratenum=vv['ratenum'],
|
||||
score=vv['score'], publisher=vv['publisher'],
|
||||
publishing=vv['publishing'],img=vv['img'].split('/')[-1]))
|
||||
publishing=vv['publishing'],description=vv['description'],
|
||||
img=vv['img'].split('/')[-1]))
|
||||
else: pass
|
||||
|
||||
|
||||
|
||||
14
parseweb.py
14
parseweb.py
@@ -87,7 +87,8 @@ testbooks =['24堂财富课',
|
||||
|
||||
class bookInfoSpide():
|
||||
|
||||
[re_bn,re_bn,re_score,re_star,re_author,re_end]=[None,None,None,None,None,None]
|
||||
[re_bn,re_bn,re_score,re_star,re_author,re_description,re_end] \
|
||||
=[None,None,None,None,None,None,None]
|
||||
if ISDOUBAN==1:
|
||||
re_bn=re.compile(r'''class=\"nbg.+?sid: (\d+?),.+?title=\"(.+?)\".+?img src=\"(.+?)\".+?rating_nums\">(.+?)<''', re.S)
|
||||
re_bn=re.compile(r'''class=\"nbg.+?sid: (\d+?),.+?title=\"(.+?)\".+?img src=\"(.+?)\"''')
|
||||
@@ -95,6 +96,7 @@ class bookInfoSpide():
|
||||
re_score=re.compile(r'''class=\"rating_nums\">(.+?)<''')
|
||||
re_ratenum=re.compile(r'''^<span>\((\d+)人评价\)</span>''')
|
||||
re_author=re.compile(r'''class=\"subject-cast\">(.+?)<''')
|
||||
re_description=re.compile(r'''^<p>(.+?)(<\/p>){0,1}$''')
|
||||
else:
|
||||
re_asin=re.compile(r'''^<div data-asin=\"(.+?)\" data-index''')
|
||||
re_img=re.compile(r'''^<img src=\"(.+?)\"$''')
|
||||
@@ -118,6 +120,7 @@ class bookInfoSpide():
|
||||
"ratenum": "1000",
|
||||
"author": "猫腻"
|
||||
"publisher": "中华书局"
|
||||
"description": "XXX"
|
||||
"publishing": "2015"
|
||||
},...}
|
||||
"""
|
||||
@@ -189,7 +192,14 @@ class bookInfoSpide():
|
||||
bkinfo[sid]['author']='/'.join(author)
|
||||
else:
|
||||
bkinfo[sid]['author']=ret[0]
|
||||
stat='DESCRIPTION'
|
||||
continue
|
||||
elif stat=='DESCRIPTION':
|
||||
ret=re.search(self.re_description, line)
|
||||
if ret:
|
||||
bkinfo[sid]['description']=ret.group(1).strip()
|
||||
stat='SID'
|
||||
continue
|
||||
else: continue
|
||||
else:
|
||||
stat='ASIN'
|
||||
@@ -271,7 +281,7 @@ class bookInfoSpide():
|
||||
mbkn=mbkinfo[0]
|
||||
for k,v in mbkinfo[1].items():
|
||||
bkn=v['bookname']
|
||||
if len(v)==8:
|
||||
if len(v)==9:
|
||||
if (not f1) and (mbkn in bkn):
|
||||
f1=1
|
||||
d1={mbkn:v}
|
||||
|
||||
@@ -86,7 +86,7 @@ testbooks=['24堂财富课',
|
||||
|
||||
class bookInfoSpide():
|
||||
|
||||
[re_bn,re_bn,re_score,re_star,re_author,re_end]=[None,None,None,None,None,None]
|
||||
[re_bn,re_bn,re_score,re_star,re_author,re_description,re_end]=[None,None,None,None,None,None,None]
|
||||
if ISDOUBAN==1:
|
||||
re_bn=re.compile(r'''class=\"nbg.+?sid: (\d+?),.+?title=\"(.+?)\".+?img src=\"(.+?)\".+?rating_nums\">(.+?)<''', re.S)
|
||||
re_bn=re.compile(r'''class=\"nbg.+?sid: (\d+?),.+?title=\"(.+?)\".+?img src=\"(.+?)\"''')
|
||||
@@ -94,6 +94,7 @@ class bookInfoSpide():
|
||||
re_score=re.compile(r'''class=\"rating_nums\">(.+?)<''')
|
||||
re_ratenum=re.compile(r'''^<span>\((\d+)人评价\)</span>''')
|
||||
re_author=re.compile(r'''class=\"subject-cast\">(.+?)<''')
|
||||
re_description=re.compile(r'''^<p>(.+?)(<\/p>){0,1}$''')
|
||||
else:
|
||||
re_asin=re.compile(r'''^<div data-asin=\"(.+?)\" data-index''')
|
||||
re_img=re.compile(r'''^<img src=\"(.+?)\"$''')
|
||||
@@ -195,7 +196,14 @@ class bookInfoSpide():
|
||||
bkinfo[sid]['author']='/'.join(author)
|
||||
else:
|
||||
bkinfo[sid]['author']=ret[0]
|
||||
stat='DESCRIPTION'
|
||||
continue
|
||||
elif stat=='DESCRIPTION':
|
||||
ret=re.search(self.re_description, line)
|
||||
if ret:
|
||||
bkinfo[sid]['description']=ret.group(1)
|
||||
stat='SID'
|
||||
continue
|
||||
else: continue
|
||||
else:
|
||||
stat='ASIN'
|
||||
@@ -277,7 +285,7 @@ class bookInfoSpide():
|
||||
mbkn=mbkinfo[0]
|
||||
for k,v in mbkinfo[1].items():
|
||||
bkn=v['bookname']
|
||||
if len(v)==8:
|
||||
if len(v)==9:
|
||||
if (not f1) and (mbkn in bkn):
|
||||
f1=1
|
||||
d1={mbkn:v}
|
||||
|
||||
Reference in New Issue
Block a user