Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .cicada/my-pipeline.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Job, Pipeline } from "https://deno.land/x/cicada@v0.1.32/lib.ts";

const job = new Job({
name: "My First Job",
image: "ubuntu:22.04",
steps: [
{
name: "Print a message",
run: "echo Hello, world!",
},
{
name: "Run a js function",
run: () => {
console.log("Hello from js");
},
},
],
});

export default new Pipeline([job]);
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deno.enablePaths": [".cicada"]
}
12 changes: 6 additions & 6 deletions apps/scraper/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def upload_to_postgres(file):

if __name__ == "__main__":
# If output file is not found then refresh data
if glob('./output/*.csv'):
print("Output found will not refresh data...")
else:
print("Output not found refreshing data...")
data_file = scrape_website()
upload_to_postgres(data_file)
# if glob('./output/*.csv'):
# print("Output found will not refresh data...")
# else:
# print("Output not found refreshing data...")
# data_file = scrape_website()
upload_to_postgres("./output/restaurants1658265034.csv")
2 changes: 1 addition & 1 deletion apps/scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self):
self.restaurants = []
self.url = base_url + query + '1'
self.content = bs(requests.get(self.url).content, 'html.parser')
self.delay_rate = 0.15
self.delay_rate = 0.02
self.total_pages = self.get_total_pages(self.content)
self.cur_year = date.today().year

Expand Down