Skip to content

Instantly share code, notes, and snippets.

@bcambel
Created January 6, 2016 10:45
Show Gist options
  • Select an option

  • Save bcambel/2e2ac7b8f1dafead4582 to your computer and use it in GitHub Desktop.

Select an option

Save bcambel/2e2ac7b8f1dafead4582 to your computer and use it in GitHub Desktop.
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