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:
@@ -50,6 +50,10 @@ def fetch_page(url):
|
||||
logger('warn', 'failed: ' + e.errno)
|
||||
|
||||
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)
|
||||
|
||||
(html, headers) = fetch_page(url)
|
||||
@@ -116,6 +120,8 @@ def extract_url(data):
|
||||
continue
|
||||
elif 2 == status:
|
||||
message = 'No title: %s' % (e(r))
|
||||
elif 3 == status:
|
||||
message = title
|
||||
else:
|
||||
message = 'some error occurred when fetching %s' % e(r)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user