Skip to content

Commit

Permalink
v 1.2.1 complete
Browse files Browse the repository at this point in the history
create site_text table in scrape
  • Loading branch information
ericnost committed Dec 15, 2023
1 parent abd3788 commit 971699a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Binary file modified dist/observatory-1.2.1-py3-none-any.whl
Binary file not shown.
Binary file modified dist/observatory-1.2.1.tar.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions src/observatory.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,10 @@ def scrape(urls):

conn = None
conn = psycopg2.connect("dbname="+credentials["postgres"]["db"]+" user="+credentials["postgres"]["user"]+" password="+credentials["postgres"]["password"]+" host=localhost port=5432")
conn.autocommit = True

cur = conn.cursor()
cur.execute("""CREATE TABLE IF NOT EXISTS public.site_text (url varchar, body_text varchar, date varchar, source varchar(10), domain varchar);""")

def DBinsert(url, contents, date, source, domain, count):
print("inserting: " + str(count), end='\r')
Expand Down

0 comments on commit 971699a

Please sign in to comment.