标题: [原创代码] python3检测phpbb3论坛版本号 [打印本页]
作者: codegay 时间: 2016-9-12 16:15 标题: python3检测phpbb3论坛版本号
- # -*- coding: UTF-8 -*-
- """
- python3检测phpbb3论坛版本号
- 2016年9月4日 10:25:06 codegay
- #通过读取docs\CHANGELOG.html 判断phpbb3的版本
- """
-
- from urllib.request import urlopen
- from urllib.parse import urljoin
- import re
- from requests import get
- test_host = ["http://www.code-by.org",
- "http://www.crug.org/",
- "http://outdrs.mobi/",
- "https://forum.catram.org/",
- "http://forum.beesay.com/",
- "http://callcq.com/",
- "http://freebt.org/",
- "http://www.gutone.com/",
- "http://forum.groovecollection.nl/",
- "http://openlora.com/forum/",
- "https://forum.ripple.com/",
- "http://forum.surdvd.com/",
- "http://www.munyu.info/phpBB3/",
- "http://forum.trinitigame.com/forum/",
- "http://forum.xueapple.com/",
- "http://www.open-gl.org/",
-
- ]
-
- log_url = "docs/CHANGELOG.html"
-
-
- def version(url):
- try:
- r = get(url)
- rec = re.compile(r"(\d\.\d+.\d+-*\w*)")
- if r.ok: # r.stats_code ==200
- result = rec.findall(r.text)
- return result[0]
- return 0
- except:
- return 0
-
-
- for r in test_host:
- url = urljoin(r,log_url)
- ver = version(url)
- print(url," ",ver)
复制代码
作者: 523066680 时间: 2016-9-12 17:49
let's do something else.
用py做做统计、数据可视化、搞个小游戏什么的。
作者: codegay 时间: 2016-9-12 18:03
回复 2# 523066680
没想法。
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |