-
Notifications
You must be signed in to change notification settings - Fork 0
/
TikiTarget.py
27 lines (22 loc) · 896 Bytes
/
TikiTarget.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class TikiTarget:
def __init__(self, parternStr = "", categoryStr = ""):
self.parternsString = parternStr
self.parterns = self.__splitPattern()
self.categoryUrl = categoryStr
def info(self):
return "Parterns: " + str(self.parternsString) + " | category: " + self.categoryUrl
def __splitPattern(self):
newList = self.parternsString.split(",")
i = 0
while i < len(newList):
newList[i] = newList[i].strip()
i+=1
return newList
# Máy ảnh, lấy liền, Fujifilm => Máy ảnh lấy liền Fujifilm
def getKeyword(self):
keyword = ""
for key in self.parterns:
keyword = keyword + " " + key
return keyword
def getSearchLink(self, pageNum):
return self.categoryUrl + "?q=" + self.getKeyword() + "&href=categorySearch&page=" + str(pageNum)