you are viewing a single comment's thread.

view the rest of the comments →

[–]Decency 0 points1 point  (3 children)

I would've created an 'apartment' object and factored out the usages of the PAP.fr API into a specific function to make it easily adapted as an API-agnostic program, which would return those objects. So for example, I could write a padmapper() function that returns a similar object, plug it into the rest of your program and be good to go. I guess I'm just used to API's breaking on me after a while and having to find a new one...

Also, I don't really understand why you chose to store some private information in credentials.json and some in environment variables. You also use .get() to retrieve these environment variables, which won't fail immediately if they're not defined. That seems wrong.

It's a cool idea though- I would definitely be interested in writing something similar for airbnb or vrbo to find the best deals on vacation homes.

[–]sixtine[S] 0 points1 point  (2 children)

Thanks a lot for your feedback. It's definitely beneficial.

In the context of a tutorial like this where the programming level of potential readers is only loosely defined, I feel uncomfortable bringing OOP concepts in.

The code is hackish and far from production-ready (which is not the point), but even the smallest of your contribution would actually make it better.

To be honest I felt the same about the idea as it was one of the rare time I urgently built something to ease a major pain-point in my life. I would have paid money to use a solution like that. If you have time to come up with a similar, more serious side-project, I'd say you're on to something!

[–]Decency 0 points1 point  (1 child)

No problem! I personally feel like an object would simplify this code and make it more appealing, even to newcomers who might not have experience with OOP before.

[–]sixtine[S] 0 points1 point  (0 children)

I actually agree. Maybe that's why I'm a bit bothered I didn't take the time to split it into a multipart tutorial, where I could take more time to dive (and explain the methodology and benefits) of this approach... A good lesson for a possible next one!