mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-19 03:30:12 +02:00
Keep checking disabled apps
This commit is contained in:
parent
14bab57b2a
commit
e01ba7039d
@ -2,7 +2,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# checkmarket2.py - part of the FDroid server tools
|
# checkmarket2.py - part of the FDroid server tools
|
||||||
# Copyright (C) 2010-11, Ciaran Gultnieks, ciaran@ciarang.com
|
# Copyright (C) 2010-12, Ciaran Gultnieks, ciaran@ciarang.com
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -44,49 +44,45 @@ html_parser = HTMLParser.HTMLParser()
|
|||||||
|
|
||||||
for app in apps:
|
for app in apps:
|
||||||
|
|
||||||
if app['disabled']:
|
print "Processing " + app['id']
|
||||||
print "Skipping %s: disabled" % app['id']
|
url = 'http://market.android.com/details?id=' + app['id']
|
||||||
|
page = urllib.urlopen(url).read()
|
||||||
|
|
||||||
|
version = None
|
||||||
|
vercode = None
|
||||||
|
|
||||||
|
m = re.search('<dd itemprop="softwareVersion">([^>]+)</dd>', page)
|
||||||
|
if m:
|
||||||
|
version = html_parser.unescape(m.group(1))
|
||||||
|
|
||||||
|
m = re.search('data-paramValue="(\d+)"><div class="goog-menuitem-content">Latest Version<', page)
|
||||||
|
if m:
|
||||||
|
vercode = m.group(1)
|
||||||
|
|
||||||
|
if not vercode:
|
||||||
|
print "...couldn't find version code"
|
||||||
|
elif not version:
|
||||||
|
print "...couldn't find version"
|
||||||
|
elif vercode == app['marketvercode'] and version == app['marketversion']:
|
||||||
|
print "...up to date"
|
||||||
else:
|
else:
|
||||||
|
print '...updating to version:' + version + ' vercode:' + vercode
|
||||||
|
newdata = ''
|
||||||
|
metafile = os.path.join('metadata', app['id'] + '.txt')
|
||||||
|
mf = open(metafile, 'r')
|
||||||
|
for line in mf:
|
||||||
|
if line.startswith('Market Version:'):
|
||||||
|
newdata += 'Market Version:' + version + '\n'
|
||||||
|
elif line.startswith('Market Version Code:'):
|
||||||
|
newdata += 'Market Version Code:' + vercode + '\n'
|
||||||
|
else:
|
||||||
|
newdata += line
|
||||||
|
mf.close()
|
||||||
|
mf = open(metafile, 'w')
|
||||||
|
mf.write(newdata)
|
||||||
|
mf.close()
|
||||||
|
|
||||||
print "Processing " + app['id']
|
time.sleep(5)
|
||||||
url = 'http://market.android.com/details?id=' + app['id']
|
|
||||||
page = urllib.urlopen(url).read()
|
|
||||||
|
|
||||||
version = None
|
|
||||||
vercode = None
|
|
||||||
|
|
||||||
m = re.search('<dd itemprop="softwareVersion">([^>]+)</dd>', page)
|
|
||||||
if m:
|
|
||||||
version = html_parser.unescape(m.group(1))
|
|
||||||
|
|
||||||
m = re.search('data-paramValue="(\d+)"><div class="goog-menuitem-content">Latest Version<', page)
|
|
||||||
if m:
|
|
||||||
vercode = m.group(1)
|
|
||||||
|
|
||||||
if not vercode:
|
|
||||||
print "...couldn't find version code"
|
|
||||||
elif not version:
|
|
||||||
print "...couldn't find version"
|
|
||||||
elif vercode == app['marketvercode'] and version == app['marketversion']:
|
|
||||||
print "...up to date"
|
|
||||||
else:
|
|
||||||
print '...updating to version:' + version + ' vercode:' + vercode
|
|
||||||
newdata = ''
|
|
||||||
metafile = os.path.join('metadata', app['id'] + '.txt')
|
|
||||||
mf = open(metafile, 'r')
|
|
||||||
for line in mf:
|
|
||||||
if line.startswith('Market Version:'):
|
|
||||||
newdata += 'Market Version:' + version + '\n'
|
|
||||||
elif line.startswith('Market Version Code:'):
|
|
||||||
newdata += 'Market Version Code:' + vercode + '\n'
|
|
||||||
else:
|
|
||||||
newdata += line
|
|
||||||
mf.close()
|
|
||||||
mf = open(metafile, 'w')
|
|
||||||
mf.write(newdata)
|
|
||||||
mf.close()
|
|
||||||
|
|
||||||
time.sleep(5)
|
|
||||||
|
|
||||||
print "Finished."
|
print "Finished."
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ Build Version:1.23,30,fae3e5f0f54fe5a2f46480481b39f9566ee9c67b
|
|||||||
Build Version:1.3),32,r1.3,target=android-8
|
Build Version:1.3),32,r1.3,target=android-8
|
||||||
Build Version:1.31,33,r1.31,target=android-8
|
Build Version:1.31,33,r1.31,target=android-8
|
||||||
Build Version:1.32,34,r1.32,target=android-8
|
Build Version:1.32,34,r1.32,target=android-8
|
||||||
|
Build Version:1.33,35,r1.33,target=android-8
|
||||||
|
|
||||||
Market Version:1.32
|
Market Version:1.33
|
||||||
Market Version Code:34
|
Market Version Code:35
|
||||||
|
Loading…
Reference in New Issue
Block a user