forked from ckorn/Upstream-watchers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pycharm.py: Upstream uses JSON for release information
Took me some JS debugging to get this URL :D
- Loading branch information
Showing
1 changed file
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
#!/usr/bin/python | ||
import re | ||
import urllib2 | ||
import json | ||
|
||
def main(): | ||
h=urllib2.urlopen("http://www.jetbrains.com/js2/version.js").read() | ||
v_finder=re.compile('var versionPyCharmLong = "(?P<version>[\d\.]+)";', re.M) | ||
m=v_finder.finditer(h) | ||
if not m: return | ||
for x in m: | ||
v=x.group("version") | ||
print "<a href='http://download-ln.jetbrains.com/python/pycharm-community-%(v)s.tar.gz'>%(v)s</a>"%locals() | ||
h=urllib2.urlopen("https://data.services.jetbrains.com/products/releases?code=PCP%2CPCC&latest=true&type=release").read() | ||
j=json.loads(h) | ||
#print json.dumps(j, indent=4, sort_keys=True) | ||
print j["PCC"][0]["downloads"]["linux"]["link"] | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |