Permalink
Browse files

OneOff now with Pagespeed

  • Loading branch information...
marcusosterberg committed Jun 3, 2017
1 parent 47bcaeb commit 794c0aa2d6c2915d4632cb3a27086cc8d219ae20
Showing with 10 additions and 4 deletions.
  1. +10 −1 default.py
  2. +0 −3 verifierad.sublime-project
View
@@ -49,6 +49,15 @@ def oneOffProcess(file, test_regime='httpStatusCodeCheck'):
print('{0} has a status code: {1}'.format(mess_to_console,
status_code).replace('\n', ''))
output_file += '{0}, {1}\n'.format(url.replace('\n', ''), status_code)
elif test_regime == 'googlePageSpeed':
check_page = google_pagespeed_check(url)
if bool(check_page):
print('{0} has been checked against Google Pagespeed API'.format(
mess_to_console))
for key in check_page:
output_file = output_file + '{0},{1},{2}\n'.format(url, key,
check_page[
key])
elif test_regime == 'mobileFriendlyCheck':
print(url)
status_message = test.mobileFriendlyCheck(url,
@@ -161,7 +170,7 @@ def checkSitemapsForNewUrls(file):
If file is executed on itself then call on a definition
"""
if __name__ == '__main__':
oneOffProcess('exempelfiler/swe-gov.txt', 'httpStatusCodeCheck')
oneOffProcess('exempelfiler/idg-top-100-2017.txt', 'googlePageSpeed')
# oneOffFromSitemap('http://www.vgregion.se/sitemap.xml', 100, 'vgregion-httpStatusCodeCheck', 'httpStatusCodeCheck')
# oneOffFromSitemap('http://www.varberg.se/sitemap.xml', 10,
# '2017-02-17T06:19:00+01:00', 'pagespeed', 'googlePageSpeed')
@@ -3,9 +3,6 @@
[
{
"path": "."
},
{
"path": "C:\\Users\\marcus\\Documents\\GitHub\\verifierad.nu.wiki"
}
]
}

0 comments on commit 794c0aa

Please sign in to comment.