diff --git a/Download-Latest-Python/downloadpython.js b/Download-Latest-Python/downloadpython.js index af139c7..1288ba3 100644 --- a/Download-Latest-Python/downloadpython.js +++ b/Download-Latest-Python/downloadpython.js @@ -53,7 +53,7 @@ async function download() { console.log(err); } break; - } + }[] } diff --git a/Download-Latest-Python/getpythonversions.js b/Download-Latest-Python/getpythonversions.js new file mode 100644 index 0000000..f155120 --- /dev/null +++ b/Download-Latest-Python/getpythonversions.js @@ -0,0 +1,20 @@ +module.exports = { + versions +} +const request = require('request'); + +function versions() +{ + return new Promise(resolve => { + request({ + uri: "https://www.python.org/ftp/python/", + }, function (error, response, body) { + const re = /"[0-9]{1,}\.[0-9]{1,}(\.[0-9]{1,})*\/"/g; + let matches = body.match(re) + matches = matches.map((value) => { + return value.slice(1,-2) + }); + resolve(matches); + }); + }) +} \ No newline at end of file