|
@@ -1,9 +1,12 @@
|
|
|
#!/usr/bin/python3
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
-# $Id: blogsiread.py,v 1.5 2022/10/01 11:36:32 springm Exp springm $
|
|
|
|
|
-# $Revision: 1.5 $
|
|
|
|
|
-# $Date: 2022/10/01 11:36:32 $
|
|
|
|
|
|
|
+# $Id: blogsiread.py,v 1.6 2022/10/10 14:30:28 springm Exp springm $
|
|
|
|
|
+# $Revision: 1.6 $
|
|
|
|
|
+# $Date: 2022/10/10 14:30:28 $
|
|
|
# $Log: blogsiread.py,v $
|
|
# $Log: blogsiread.py,v $
|
|
|
|
|
+# Revision 1.6 2022/10/10 14:30:28 springm
|
|
|
|
|
+# Summary: lfi repariert
|
|
|
|
|
+#
|
|
|
# Revision 1.5 2022/10/01 11:36:32 springm
|
|
# Revision 1.5 2022/10/01 11:36:32 springm
|
|
|
# Summary: Works
|
|
# Summary: Works
|
|
|
#
|
|
#
|
|
@@ -180,12 +183,10 @@ def lfionlinede(b, domain, i):
|
|
|
m = hashlib.sha256()
|
|
m = hashlib.sha256()
|
|
|
html = ""
|
|
html = ""
|
|
|
ts = 0 # timestamp
|
|
ts = 0 # timestamp
|
|
|
- url = 'https://lfi-online.de/ceemes/de/blog/'
|
|
|
|
|
- logger.debug(f"{b[1]}")
|
|
|
|
|
with urllib.request.urlopen(b[1]) as response:
|
|
with urllib.request.urlopen(b[1]) as response:
|
|
|
html = response.read()
|
|
html = response.read()
|
|
|
p = re.search('titlebox30 cu-pointer[\'"] onclick=[\'"]window.location\s*=\s*[\'"](https://.*?)[\'"][\'"]>\s*<h1.*?>(.*?)</h1', html.decode('utf-8'), re.MULTILINE | re.DOTALL)
|
|
p = re.search('titlebox30 cu-pointer[\'"] onclick=[\'"]window.location\s*=\s*[\'"](https://.*?)[\'"][\'"]>\s*<h1.*?>(.*?)</h1', html.decode('utf-8'), re.MULTILINE | re.DOTALL)
|
|
|
- logger.debug(f"{p[2]}")
|
|
|
|
|
|
|
+ # logger.debug(f"{p[2]}")
|
|
|
string2hash = f"""p[2]"""
|
|
string2hash = f"""p[2]"""
|
|
|
m.update(string2hash.encode('utf-8'))
|
|
m.update(string2hash.encode('utf-8'))
|
|
|
hash = (m.hexdigest())
|
|
hash = (m.hexdigest())
|
|
@@ -213,6 +214,37 @@ def lfionlinede(b, domain, i):
|
|
|
return (q, meta_values[domain]['timestamp'])
|
|
return (q, meta_values[domain]['timestamp'])
|
|
|
return (b, meta_values[domain]['timestamp'])
|
|
return (b, meta_values[domain]['timestamp'])
|
|
|
|
|
|
|
|
|
|
+def picturesfromthezone(b, domain, i):
|
|
|
|
|
+ global meta_values
|
|
|
|
|
+ m = hashlib.sha256()
|
|
|
|
|
+ html = ""
|
|
|
|
|
+ ts = 0 # timestamp
|
|
|
|
|
+ with urllib.request.urlopen(b[1]) as response:
|
|
|
|
|
+ html = response.read()
|
|
|
|
|
+ string2hash = f"""html"""
|
|
|
|
|
+ m.update(string2hash.encode('utf-8'))
|
|
|
|
|
+ hash = (m.hexdigest())
|
|
|
|
|
+ if not domain in meta_values: # first run
|
|
|
|
|
+ logger.debug(domain)
|
|
|
|
|
+ meta_values[domain] = { 'hash': '1' } # fake value
|
|
|
|
|
+ if not meta_values[domain]['hash'] == hash: # Unterschiedliche Hashes
|
|
|
|
|
+ logger.debug('unterschiedliche hashes')
|
|
|
|
|
+ meta_values[domain] = { 'hash': hash,
|
|
|
|
|
+ 'timestamp': timestamp - i,
|
|
|
|
|
+ 'posttitle': '',
|
|
|
|
|
+ 'posturl': b[1] }
|
|
|
|
|
+ q = {}
|
|
|
|
|
+ q[2] = ''
|
|
|
|
|
+ q[1] = b[1]
|
|
|
|
|
+ return (q, timestamp + i)
|
|
|
|
|
+ else:
|
|
|
|
|
+ logger.debug('gleiche hashes')
|
|
|
|
|
+ q = {}
|
|
|
|
|
+ q[1] = meta_values[domain]['posturl']
|
|
|
|
|
+ q[2] = meta_values[domain]['posttitle']
|
|
|
|
|
+ return (q, meta_values[domain]['timestamp'])
|
|
|
|
|
+ # return (b, meta_values[domain]['timestamp'])
|
|
|
|
|
+
|
|
|
def treat_special_domain(domain, b, i):
|
|
def treat_special_domain(domain, b, i):
|
|
|
ts = 0
|
|
ts = 0
|
|
|
if domain == 'www.orengrad.com':
|
|
if domain == 'www.orengrad.com':
|
|
@@ -220,12 +252,11 @@ def treat_special_domain(domain, b, i):
|
|
|
# elif domain == 'jims-ramblings.blogspot.com':
|
|
# elif domain == 'jims-ramblings.blogspot.com':
|
|
|
# print(f"special: {domain}")
|
|
# print(f"special: {domain}")
|
|
|
elif domain == 'lfi-online.de':
|
|
elif domain == 'lfi-online.de':
|
|
|
- logger.debug(f"{b[1]} {b[2]}")
|
|
|
|
|
(b, ts) = lfionlinede(b, domain, i)
|
|
(b, ts) = lfionlinede(b, domain, i)
|
|
|
elif domain == 'photoplacegallery.com':
|
|
elif domain == 'photoplacegallery.com':
|
|
|
(b, ts) = photoplacegallery(b, domain, i)
|
|
(b, ts) = photoplacegallery(b, domain, i)
|
|
|
- # elif domain == 'www.picturesfromthezone.com':
|
|
|
|
|
- # print(f"special: {domain}")
|
|
|
|
|
|
|
+ elif domain == 'www.picturesfromthezone.com':
|
|
|
|
|
+ (b, ts) = picturesfromthezone(b, domain, i)
|
|
|
return (b, ts)
|
|
return (b, ts)
|
|
|
|
|
|
|
|
def read_spring2life_links():
|
|
def read_spring2life_links():
|
|
@@ -252,8 +283,6 @@ def read_spring2life_links():
|
|
|
else:
|
|
else:
|
|
|
(z, ts) = treat_special_domain(bdomain, b, counter)
|
|
(z, ts) = treat_special_domain(bdomain, b, counter)
|
|
|
blogtimestamp = ts
|
|
blogtimestamp = ts
|
|
|
- if bdomain == 'lfi-online.de':
|
|
|
|
|
- logger.debug(f"into list: \n{burl} // {b[2]}\n{z[1]} // {z[2]}")
|
|
|
|
|
counter += 1
|
|
counter += 1
|
|
|
list_of_blogs[int(blogtimestamp)] = (f"""<li><a href='{burl}' target='_blank'>{b[2]}</a>"""
|
|
list_of_blogs[int(blogtimestamp)] = (f"""<li><a href='{burl}' target='_blank'>{b[2]}</a>"""
|
|
|
f""" // <a href='{z[1]}' target='_blank'>{z[2]}</a></li>""")
|
|
f""" // <a href='{z[1]}' target='_blank'>{z[2]}</a></li>""")
|