added config folder to git
This commit is contained in:
18
volumes/config/scripts/limbowiki_get_info.py
Executable file
18
volumes/config/scripts/limbowiki_get_info.py
Executable file
@@ -0,0 +1,18 @@
|
||||
from lxml import html
|
||||
import requests
|
||||
|
||||
# Request the page
|
||||
try:
|
||||
page = requests.get('https://wiki.limbosolutions.com/index.php/P%C3%A1gina_principal', timeout=2)
|
||||
|
||||
# Parsing the page
|
||||
# (We need to use page.content rather than
|
||||
# page.text because html.fromstring implicitly
|
||||
# expects bytes as input.)
|
||||
tree = html.fromstring(page.content)
|
||||
|
||||
# Get element using XPath
|
||||
buyers = tree.xpath('string(//html//head//meta//@content)')
|
||||
print("{\"status\":\"On\",\"version\":\"" + buyers + "\"}")
|
||||
except:
|
||||
print("{\"status\":\"error\"}")
|
||||
Reference in New Issue
Block a user