add watch scripts for sourceforge lgames
This commit is contained in:
parent
c92af8eedf
commit
5f3f521fed
23
lbreakouthd/.watch
Executable file
23
lbreakouthd/.watch
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from subprocess import Popen,PIPE
|
||||
from bs4 import BeautifulSoup as bs
|
||||
|
||||
def get_html(url):
|
||||
try:
|
||||
curlpipe = Popen(["/usr/bin/curl","-s","-L",url],stdout=PIPE)
|
||||
except:
|
||||
print("- Request error: unable to retrieve {}".format(url))
|
||||
return None
|
||||
curltup = curlpipe.communicate()
|
||||
return curltup[0]
|
||||
|
||||
page = get_html("https://lgames.sourceforge.io/downloads.php")
|
||||
soup = bs(page, 'lxml')
|
||||
refs = soup.body.find_all('a')
|
||||
|
||||
for a in refs:
|
||||
nv=a.get_text()
|
||||
if nv[0:11] == "lbreakouthd" and nv[-6:] == "tar.gz":
|
||||
print(nv[12:-7])
|
||||
break
|
23
ltris/.watch
Executable file
23
ltris/.watch
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from subprocess import Popen,PIPE
|
||||
from bs4 import BeautifulSoup as bs
|
||||
|
||||
def get_html(url):
|
||||
try:
|
||||
curlpipe = Popen(["/usr/bin/curl","-s","-L",url],stdout=PIPE)
|
||||
except:
|
||||
print("- Request error: unable to retrieve {}".format(url))
|
||||
return None
|
||||
curltup = curlpipe.communicate()
|
||||
return curltup[0]
|
||||
|
||||
page = get_html("https://lgames.sourceforge.io/downloads.php")
|
||||
soup = bs(page, 'lxml')
|
||||
refs = soup.body.find_all('a')
|
||||
|
||||
for a in refs:
|
||||
nv=a.get_text()
|
||||
if nv[0:5] == "ltris" and nv[-6:] == "tar.gz":
|
||||
print(nv[6:-7])
|
||||
break
|
Loading…
Reference in New Issue
Block a user