import urllib.request
import json
import pprint
import os

#get the version from npm registry
repoName = "graphql-js"
owner = "graphql"
githubUrl = "https://github.com/graphql/graphql-js.git"
testUrl = "https://registry.npmjs.org/" + owner

with urllib.request.urlopen(testUrl) as url:
    npmReg = json.loads(url.read().decode())
    githubApi = "https://api.github.com/repos/" + owner + "/" + repoName + "/tags"
    with urllib.request.urlopen(githubApi) as urlGithub:
        githubData = json.loads(urlGithub.read().decode())
        for version in npmReg["versions"]:
            version.encode("utf-8")
            # print (version)
            for index, value in enumerate(githubData):
                if githubData[index]["name"] == (version) or githubData[index]["name"] == ("v" + version):
                    print (version, "Matched")
        # print ("Github Versions")
        # for index, value in enumerate(githubData):
        #     print (githubData[index]["name"])

d6b318bdbf6494f6b3384d819f4cd6471a8026dd
<mask token>

<mask token>
with urllib.request.urlopen(testUrl) as url:
    npmReg = json.loads(url.read().decode())
    githubApi = ('https://api.github.com/repos/' + owner + '/' + repoName +
        '/tags')
    with urllib.request.urlopen(githubApi) as urlGithub:
        githubData = json.loads(urlGithub.read().decode())
        for version in npmReg['versions']:
            version.encode('utf-8')
            for index, value in enumerate(githubData):
                if githubData[index]['name'] == version or githubData[index][
                    'name'] == 'v' + version:
                    print(version, 'Matched')

<mask token>
repoName = 'graphql-js'
owner = 'graphql'
githubUrl = 'https://github.com/graphql/graphql-js.git'
testUrl = 'https://registry.npmjs.org/' + owner
with urllib.request.urlopen(testUrl) as url:
    npmReg = json.loads(url.read().decode())
    githubApi = ('https://api.github.com/repos/' + owner + '/' + repoName +
        '/tags')
    with urllib.request.urlopen(githubApi) as urlGithub:
        githubData = json.loads(urlGithub.read().decode())
        for version in npmReg['versions']:
            version.encode('utf-8')
            for index, value in enumerate(githubData):
                if githubData[index]['name'] == version or githubData[index][
                    'name'] == 'v' + version:
                    print(version, 'Matched')

import urllib.request
import json
import pprint
import os
repoName = 'graphql-js'
owner = 'graphql'
githubUrl = 'https://github.com/graphql/graphql-js.git'
testUrl = 'https://registry.npmjs.org/' + owner
with urllib.request.urlopen(testUrl) as url:
    npmReg = json.loads(url.read().decode())
    githubApi = ('https://api.github.com/repos/' + owner + '/' + repoName +
        '/tags')
    with urllib.request.urlopen(githubApi) as urlGithub:
        githubData = json.loads(urlGithub.read().decode())
        for version in npmReg['versions']:
            version.encode('utf-8')
            for index, value in enumerate(githubData):
                if githubData[index]['name'] == version or githubData[index][
                    'name'] == 'v' + version:
                    print(version, 'Matched')

import urllib.request
import json
import pprint
import os

#get the version from npm registry
repoName = "graphql-js"
owner = "graphql"
githubUrl = "https://github.com/graphql/graphql-js.git"
testUrl = "https://registry.npmjs.org/" + owner

with urllib.request.urlopen(testUrl) as url:
    npmReg = json.loads(url.read().decode())
    githubApi = "https://api.github.com/repos/" + owner + "/" + repoName + "/tags"
    with urllib.request.urlopen(githubApi) as urlGithub:
        githubData = json.loads(urlGithub.read().decode())
        for version in npmReg["versions"]:
            version.encode("utf-8")
            # print (version)
            for index, value in enumerate(githubData):
                if githubData[index]["name"] == (version) or githubData[index]["name"] == ("v" + version):
                    print (version, "Matched")
        # print ("Github Versions")
        # for index, value in enumerate(githubData):
        #     print (githubData[index]["name"])
