Created
January 6, 2016 10:45
-
-
Save bcambel/2e2ac7b8f1dafead4582 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import json | |
| import requests | |
| import tqdm | |
| PROJ_URL = "http://server/p/" | |
| ES_URL = 'http://es/hackersome/github_project/' | |
| def update(proj): | |
| d = requests.get(PROJ_URL + proj + "?json=1").json() | |
| resp = requests.put(ES_URL+str(d['id']), json.dumps(d)) | |
| def execute(fi): | |
| f = open(fi,'r').readlines() | |
| for proj in tqdm(f[:10]): | |
| update(proj.replace("\n","")) | |
| import sys | |
| if __name__ == "__main__": | |
| execute(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment