Now we're going to create the app inside of Heroku.
So it's fairly simple.
You just say new and well, you go into the main page and you say new to create a new app and you give
it a name.
So like Craigslist cars, I will call mine and choose a region.
Choose your United States.
I pick that and then we get some deployment methods created with some deployment method methods.
I will go ahead since we already have a git repository initialized in this which we use git clone from.
I'm going to say I use this git heroku git remote with the Craigslist cars app name so that we create
this remote repository are added to our git repository.
So basically in the terminal, make sure you're on the car scraper folder and paste in this command
with the git remote and the slash A that's going to create this remote Heroku repository or whatever
you call it so we can push something onto Heroku.
And so then, well, we can push to git push Heroku master and.
Dennis should start building onto Heroku.
So the build has succeeded and it's done.
Everything is done and good.
Now we can go ahead, refresh this site.
Inside the overview.
We can see that the build has succeeded.
And if we now we can now go in and add this extra add on to set up some, some sort of scheduling.
So if you go ahead.
Inside of resources and then in here in the resources underneath.
Go ahead and search for scheduler and pick the Heroku scheduler.
And in here?
Well, I only have the free plan, so that's just what I'm going to go with.
And then I'll click on provision.
And then in here you can click on the Heroku scheduler, add on on the link here.
And you're being taken to a next site where you can select, add new job, and then you can enter in
a command that you want to run at this specific interval.
So in my case, it's Node index.js, which I use to start up the script we have in here.
Everything is running from Index.js.
So then I set that up and I said, You can set a frequency.
You can set a daily frequency, a hourly or every ten minutes.
So I'm going to go with every ten minutes for this little test, and then I will say save.
And now it's going to say when the job is next to.
So it says it's next to is 2012.
And that is.
In one minute, I think.
So inside of my database right now.
We have 120 collections, so let me delete all of the collections first so we can see if the scheduler
is actually running this job.
So now all is left is for me to try and wait a little, be a little patient and see if the scheduler
is actually getting the results.
And now I can see that the schedule has run, had a last run at 2012.
And I also could see that it actually had written 120 documents into my M-lab database.
So everything is working as I expected.
And now the next due for this schedule is 2022.
And then I can just wait for a little while for an hour.
And you should see that there's extra cars being written into the database.
So that is it, folks.
That is how you create a new scheduler or create a deployment into Heroku and schedule your scraper
to run at specific intervals.
So I hope you can use this for something and good luck and have fun scraping.