1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00

print special message for 'repo/urlbot.git'

This commit is contained in:
urlbot
2014-08-09 20:29:38 +02:00
parent b904246c14
commit 1daa49d690

View File

@@ -50,6 +50,10 @@ def fetch_page(url):
logger('warn', 'failed: ' + e.errno) logger('warn', 'failed: ' + e.errno)
def extract_title(url): def extract_title(url):
if 'repo/urlbot.git' in url:
logger('info', 'repo URL found: ' + url)
return (3, 'wee, that looks like my home repo!')
logger('info', 'extracting title from ' + url) logger('info', 'extracting title from ' + url)
(html, headers) = fetch_page(url) (html, headers) = fetch_page(url)
@@ -116,6 +120,8 @@ def extract_url(data):
continue continue
elif 2 == status: elif 2 == status:
message = 'No title: %s' % (e(r)) message = 'No title: %s' % (e(r))
elif 3 == status:
message = title
else: else:
message = 'some error occurred when fetching %s' % e(r) message = 'some error occurred when fetching %s' % e(r)