|
|
@@ -132,18 +132,17 @@ def photoplacegallery(b, domain, i):
|
|
|
with r as response:
|
|
|
html = response.read()
|
|
|
# hash only from content-relevant part of website
|
|
|
- subset = re.search('(<div class="main">.*?</div>\s*</div>\s*</div>)', html.decode('utf-8'),
|
|
|
- re.MULTILINE | re.DOTALL )
|
|
|
+ subset = re.search( '<div class="main">.*?<div class="widget-title"><a href=".*?" class="h3">(.*?)</a>.*?</div>\s*</div>\s*</div>', html.decode('utf-8'), re.MULTILINE | re.DOTALL )
|
|
|
m.update(subset[1].encode('utf-8'))
|
|
|
hash = (m.hexdigest())
|
|
|
if not domain in meta_values: # first run
|
|
|
meta_values[domain] = { 'hash': '1' } # fake value
|
|
|
if not meta_values[domain]['hash'] == hash: # Unterschiedliche Hashes
|
|
|
- # logger.debug(f"unterschiedliche hashes")
|
|
|
+ logger.debug(f"unterschiedliche hashes")
|
|
|
meta_values[domain]['hash'] = hash
|
|
|
p = re.search('<div class="widget-title"><a href="(/online-juried-shows/[^"]*?)" class="h3">([^<]*?)</a></div>', html.decode('utf-8'), re.MULTILINE | re.DOTALL )
|
|
|
if p:
|
|
|
- # logger.debug(f"re search erfolgreich: {p[1]} {p[2]}")
|
|
|
+ logger.debug(f"re search erfolgreich: {p[1]} {p[2]}")
|
|
|
meta_values[domain] = { 'hash': hash,
|
|
|
'timestamp': timestamp - i,
|
|
|
'posttitle': p[2],
|
|
|
@@ -157,12 +156,11 @@ def photoplacegallery(b, domain, i):
|
|
|
pass
|
|
|
#print('p is empty :(')
|
|
|
else:
|
|
|
- # logger.debug(f"gleiche hashes")
|
|
|
+ logger.debug(f"gleiche hashes")
|
|
|
q = {}
|
|
|
q[1] = meta_values[domain]['posturl']
|
|
|
q[2] = meta_values[domain]['posttitle']
|
|
|
return (q, meta_values[domain]['timestamp'])
|
|
|
- #print('hashes are equal')
|
|
|
return (b, meta_values[domain]['timestamp'])
|
|
|
|
|
|
def lfionlinede(b, domain, i):
|
|
|
@@ -320,7 +318,7 @@ def main():
|
|
|
'handlers': {
|
|
|
'default_handler': {'class': 'logging.StreamHandler',
|
|
|
'formatter': 'standard',
|
|
|
- 'level': logging.WARN },
|
|
|
+ 'level': logging.WARN},
|
|
|
# {
|
|
|
# 'class': 'logging.FileHandler',
|
|
|
# 'level': 'DEBUG',
|