Skip to content

Commit 1c88d19

Browse files
committed
bugfixes
1 parent 0cce1dc commit 1c88d19

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

config_template.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818

1919
sites = [
2020

21-
{'name': 'example-webpage',
21+
{'name': 'example-css',
22+
'parsers': [uri(uri='https://github.com/mtill', contenttype='html'),
23+
css(contentcss='div')
24+
]
25+
},
26+
27+
{'name': 'example-xpath',
2228
'parsers': [uri(uri='https://example-webpage.com/test', contenttype='html'),
2329
xpath(contentxpath='//div[contains(concat(\' \', normalize-space(@class), \' \'), \' package-version-header \')]')
2430
]
@@ -34,9 +40,7 @@
3440

3541
#os.chdir('/path-to-data-dir/MailWebsiteChanges-data')
3642

37-
subjectPostfix = 'A website has been updated!'
38-
39-
enableMailNotifications = True
43+
enableMailNotifications = False
4044
maxMailsPerSession = -1
4145
4246
smtphost = 'mysmtpprovider.com'
@@ -46,9 +50,7 @@
4650
smtppwd = 'mypassword'
4751
receiver = '[email protected]'
4852

49-
os.chdir('/var/cache/mwc')
50-
51-
enableRSSFeed = True
53+
enableRSSFeed = False
5254
rssfile = 'feed.xml'
5355
maxFeeds = 100
5456

mwctools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import subprocess
44

55
from lxml import etree
6+
from cssselect import GenericTranslator
67
import re
78

89

@@ -44,7 +45,7 @@ def getSubject(textContent):
4445
global maxTitleLength
4546

4647
if textContent == None or textContent == '':
47-
return config.subjectPostfix
48+
return 'A website has been updated'
4849
textContent = re.sub(' +', ' ', re.sub('\s', ' ', textContent)).strip()
4950
return (textContent[:maxTitleLength] + ' [..]') if len(textContent) > maxTitleLength else textContent
5051

@@ -192,7 +193,7 @@ def __init__(self, contentcss, titlecss=None, contenttype='html'):
192193

193194
# input: [Content], output: [Content]
194195
def performAction(self, contentList):
195-
return self.xpathparser.parse(contentList)
196+
return self.xpathparser.performAction(contentList)
196197

197198

198199
class RegExParser(Parser):

0 commit comments

Comments
 (0)