Skip to content

Instantly share code, notes, and snippets.

@sfaleron sfaleron/
Last active Nov 2, 2017

What would you like to do?
Check the current version of maven artifacts at jcenter
# Query the current version of maven artifacts at jcenter
# Current favorites:
# org=org.jetbrains.kotlin pkg=kotlin-runtime
# org=io.kotlintest pkg=kotlintest
# org=no.tornado pkg=tornadofx
import requests
url = ''
aliases = {'pkg':'a', 'org': 'g'}
_defaults = {
'repo' : 'jcenter'
def query(**kwargs):
for k,v in kwargs.items():
if k in aliases:
del kwargs[k]
req = requests.get(url, params=kwargs)
if req.status_code == 200:
return req.json()[0]['versions'][0]
return ''
if __name__ == '__main__':
import sys
ans = query(**dict([i.split('=') for i in sys.argv[1:]]))
ans = ''
print(ans if ans else 'Request failed!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.