chiark / gitweb /
Keep checking disabled apps
authorCiaran Gultnieks <ciaran@ciarang.com>
Tue, 3 Jan 2012 15:35:29 +0000 (15:35 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Tue, 3 Jan 2012 15:35:29 +0000 (15:35 +0000)
checkmarket2.py
metadata/com.morphoss.acal.txt

index d1568291e26f2d37f3885ec688869f9519b12dce..6fd61c2cfd2e9360650395086bcbaa598e1c1736 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 #
 # 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
 # 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:
 
-    if app['disabled']:
-        print "Skipping %s: disabled" % app['id']
-    else:
-
-        print "Processing " + app['id']
-        url = 'http://market.android.com/details?id=' + app['id']
-        page = urllib.urlopen(url).read()
+    print "Processing " + app['id']
+    url = 'http://market.android.com/details?id=' + app['id']
+    page = urllib.urlopen(url).read()
 
-        version = None
-        vercode = None
+    version = None
+    vercode = None
 
-        m = re.search('<dd itemprop="softwareVersion">([^>]+)</dd>', page)
-        if m:
-            version = html_parser.unescape(m.group(1))
+    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)
+    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)
+    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."
 
index b86eebd62262c62352fc30c34c9b0aad744080c8..3527acfde7964bb7e75a83c107668ed5ca823f0f 100644 (file)
@@ -24,6 +24,7 @@ Build Version:1.23,30,fae3e5f0f54fe5a2f46480481b39f9566ee9c67b
 Build Version:1.3),32,r1.3,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.33,35,r1.33,target=android-8
 
-Market Version:1.32
-Market Version Code:34
+Market Version:1.33
+Market Version Code:35