def make_job_asin(asin, app_id, asin_url): job_id = 'asin_%s'%(asin) job_url = asin_url job_file_path = '/web_jobs/%s-asin/%s.html'%(job_target, job_id) client_id = 'db_insert_row.py' create_date = str(datetime.datetime.now()) update_date = str(datetime.datetime.now()) job_status = 1 http_status = -1 job = myinsert.make_job(job_id, job_url, job_file_path, client_id, create_date, update_date, job_status, http_status) return job
def make_job(i): thing_id = str(i); job_id = 't_'+thing_id; job_url = 'http://www.thingiverse.com/thing:'+thing_id ##+'/' ## do not forge to add / in the end job_file_path = 'web_jobs/%s/%s.html'%(job_target, job_id) client_id = 'db_insert_row.py' create_date = str(datetime.now()) update_date = str(datetime.now()) job_status = 1 http_status = -1 job = myinsert.make_job(job_id, job_url, job_file_path, client_id, create_date, update_date, job_status, http_status) return job
def make_job_appid(app_id, asin): job_id = 'appid_%s'%(app_id) params = urllib.urlencode({ 'id':app_id }) job_url_base = "https://play.google.com/store/apps/details" job_url = '%s?%s'%(job_url_base, params) job_file_path = '/web_jobs/%s-appid/%s.html'%(job_target, job_id) client_id = 'db_insert_row.py' create_date = str(datetime.datetime.now()) update_date = str(datetime.datetime.now()) job_status = 1 http_status = -1 job = myinsert.make_job(job_id, job_url, job_file_path, client_id, create_date, update_date, job_status, http_status) return job
def make_job(s, tw_username, maxtime): job_id = s params = urllib.urlencode({ 'q':'from:%s'%tw_username, 'type':'tweet', 'perpage':100, 'page': 1, 'maxtime':maxtime, 'sort_method': 'date', 'apikey': '09C43A9B270A470B8EB8F2946A9369F3' }) job_url_base = "http://otter.topsy.com/search.json" job_url = '%s?%s'%(job_url_base, params) job_file_path = '/web_jobs/%s/%s.html'%(job_target, job_id) client_id = 'db_insert_row.py' create_date = str(datetime.datetime.now()) update_date = str(datetime.datetime.now()) job_status = 1 http_status = -1 job = myinsert.make_job(job_id, job_url, job_file_path, client_id, create_date, update_date, job_status, http_status) return job