Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
danozgriff committed Feb 25, 2016
1 parent 8156af2 commit f1f2d01
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scraper.py
Expand Up @@ -8,7 +8,7 @@

#scraperwiki.sqlite.execute("create table Company_Performance (`TIDM` varchar2(8) NOT NULL, `1D` real, `3D` real, `1W` real, '1M' real, '6M' real, `Date` date, UNIQUE (`TIDM`, `Date`))")

if 1==0:
if 1==1:

complist = scraperwiki.sqlite.execute("select `TIDM`, `Price` from company where TIDM in (select distinct TIDM from Signal_History)")

Expand All @@ -26,14 +26,17 @@
#D-1

d1date=ndate - datetime.timedelta(days=10)
d1list = scraperwiki.sqlite.execute("select `Price` from Signal_History where tidm = '" + tidm + "' and strftime('%Y', date) = '" + str(d1date.year) + "' and strftime('%-m', date) = '" + str(d1date.month) + "' and strftime('%-d', date) = '" + str(d1date.day) + "'")
#d1list = scraperwiki.sqlite.execute("select `Price` from Signal_History where tidm = '" + tidm + "' and strftime('%Y', date) = '" + str(d1date.year) + "' and strftime('%-m', date) = '" + str(d1date.month) + "' and strftime('%-d', date) = '" + str(d1date.day) + "'")
d1list = scraperwiki.sqlite.execute("select `TIDM`, `Price`, `Date` from Signal_History where tidm = '" + tidm + "' and strftime('%Y', date) = '" + str(d1date.year) + "'")

for y in d1list["data"]:
print y[0]
break
print y[1]
print y[2]

break

if 1==1:
if 1==0:
tidm = "test"
ndate=datetime.date.today()
d1date=ndate - datetime.timedelta(days=10)
Expand Down

0 comments on commit f1f2d01

Please sign in to comment.