Ejemplo n.º 1
0
					fulfill_html.fulfill(file_date,0,0,form,company_sk,eh_sk)
					print "html fulfill complete"
					fulfill_raw.fulfill_raw(file_date,0,0,form,company_sk,eh_sk,"","")

					#Tweet about it
	
					if symbol != "NA":
						try:
							tweet.tweet(name, exchange, symbol, form)

						except:
							print "no tweets!"

					print "Attempting to fulfill id (pre validation) raw and html"
					print " fulfill_id.fulfill(\""+file_date+"\",0,1,\""+str(form)+"\","+str(company_sk)+","+str(form)+")"
					num_companies = fulfill_id.fulfill(file_date,0,0,form,company_sk,eh_sk,"","")
					if num_companies == "1":
						print "insert into validation (company_sk, form, status, date_id, stamp_created,stamp_updated) values ("+str(company_sk)+",\""+form+"\",\"N\", "+str(date_id)+",null,null"
						cursor.execute("insert into validation (company_sk, form, status, date_id, stamp_created,stamp_updated,eh_sk) values ("+str(company_sk)+",\""+form+"\",\"N\", "+str(date_id)+",null,null,"+str(eh_sk)+")")
						conn.commit()

				
				else:
					print "Rss says period is "+period
					print "Error! Moving to: "+error_fn
					company_sk =  -1
					html_link, html_fn = pull_html(symbol,form,cik,file_date,temp_path,html_base_fn,html_extension_fn,link)
					shutil.move(file,error_fn)
					try:
						print "Inserting error into insert extract history value:"
						#cursor.execute("insert into extract_history (`cik`,`name`,`period`,`form`,`date_id`,`html`,`html_link`,`status`) values (\""+str(cik)+"\",\""+name+"\", \""+period+"\", \""+str(form)+"\", "+str(date_id)+",\""+html_fn+"\",\""+html_link+"\",\"E\")")
Ejemplo n.º 2
0
                            cik + "\"")
                        company_sk = cursor.fetchone()[0]

                        print "fulfilling raw and html"
                        #PMB FIGURE OUT WHERE THESE ARE LANDING THEIR DATA..  MANIPULATE?
                        print "html fulfill complete"
                        fulfill_raw.fulfill_raw(file_date, 0, 0, form,
                                                company_sk, eh_sk, loaded_path,
                                                basename + "_parsed.csv")

                        print "Attempting to fulfill id (pre validation) raw and html"
                        print " fulfill_id.fulfill(\"" + file_date + "\",0,1,\"" + str(
                            form) + "\"," + str(company_sk) + "," + str(
                                form) + ")"
                        num_companies = fulfill_id.fulfill(
                            file_date, 1, 1, form, company_sk, eh_sk,
                            loaded_path, basename + "_instrumental.csv")

                        sys.exit(0)

                    else:
                        print "Rss says period is " + period
                        print "Error! Moving to: " + error_fn
                        company_sk = -1
                        html_link, html_fn = pull_html(symbol, form, cik,
                                                       file_date, temp_path,
                                                       html_base_fn,
                                                       html_extension_fn, link)
                        shutil.move(file, error_fn)
                        try:
                            print "Inserting error into insert extract history value:"