Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsuss committed Oct 6, 2024
1 parent 775085a commit 4bd71cc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.venv
.env
.Rproj.user
2 changes: 1 addition & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from os.path import abspath

data = get_data()
write_data(abspath("./data/test.csv"), data)
write_data(abspath("./data/superforecasts.csv"), data)
14 changes: 12 additions & 2 deletions src/fetch.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import requests

def get_data():
res = requests.get("https://dummyjson.com/products?limit=10&select=id,title,brand,price")
data = res.json().get('products')
# res = requests.get("https://dummyjson.com/products?limit=10&select=id,title,brand,price")
# data = res.json().get('products')
# print(f"Loaded {len(data)} rows of JSON from the API")
# return data

r = requests.get("https://www.goodjudgment.io/futurefirst/api/forecasts", headers = {"Authorization": "Bearer 8030152dfa8a9930ec132f831500dd54c55c1889"})
#r.json()
#r.json()["status"]
data = r.json()["data"]
print(f"Loaded {len(data)} rows of JSON from the API")
return data

#res = r.json()

0 comments on commit 4bd71cc

Please sign in to comment.