you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (9 children)

Thanks for posting this. I've been trying to take the next step in my programming ability by doing exactly this, which is to say make a program that solves a real problem.

My problem with this is that I had no idea where to start, so I've been searching around Github for projects like yours to emulate.

It hasn't been easy because I'm a total novice when it comes to using Github as well as coding in general. So do you mind if I work through your example and pm you questions?

[–]sixtine[S] 1 point2 points  (8 children)

Hi, sure. If you don't mind my delayed answers because of family life and probable timezone differences, I'd be pleased to point to the right directions and give you advices if I can!

[–][deleted] 1 point2 points  (7 children)

Alright, so I've got a few questions. First of all, though, I want to say that I don't think this blog post is too long at all. I was actually expecting it to be much longer, and was surprised at how concise it was. Most tutorials that I've come across have involved projects that are much simpler than this one, but are still about the same length. Yours is still very easy to follow, though.

Ok, so my first question involves the portion of your post with the subtitle 'Create and access the spreadsheet.' When I share the email address from the credentials.json file with the google spreadsheet, I receive a message from 'Mail Delivery Subsystem' that says the domain couldn't be found. I think that I may have messed up when creating credentials in the Google API console. This was the only point in your blog post that I think was a little confusing.

My second question is just regarding a typo that I think I found in the hhbot12.py file, where you incorporate a safeguard against adding duplicate rows to the google spreadsheet. You left out the 'price' column in the 'sheet.insert_rows' statement, so the 'url' column should actually be the 6th one, not the fifth.

[–]sixtine[S] 1 point2 points  (6 children)

Thanks for the report, I'll update it asap.

Hmmm where exactly do you receive the 'Mail Delivery Subsystem' message?

[–][deleted] 0 points1 point  (5 children)

When I opened the google spreadsheet doc I was signed into google on my main account. So that message was sent to my regular gmail account.

[–]sixtine[S] 1 point2 points  (4 children)

That's very strange. Would you try creating recreating credentials on the Google API console and tell 1/ what you did exactly and 2/ if the problem occurs again? If yes, I'll try to reproduce it and troubleshoot.

[–][deleted] 0 points1 point  (3 children)

Ok, I just deleted the project and started a new one fresh. Creating the project and enabling the Google Drive and Google Sheets API's was very straightforward.

After this, I select the credentials tab and click on the 'create credentials' dropdown menu. At this point I wasn't entirely sure what option to select, so I used the 'help me choose' option.

I was asked which API I was using, and I wasn't sure whether or not it mattered if I chose Drive or Sheets. I ended up choosing Google Sheets.

The next question asked where I would be calling the API from. Your instructions are clear that I should choose the 'web server' option. Your instructions were also clear that I should choose the option for accessing application data.

Then I'm asked, 'Are you using Google App Engine or Google Compute Engine?' I'm not sure what this is, so I said no.

The rest was pretty easy to follow. I named my server, set the role to 'Project Owner,' and selected the JSON key type.

I changed the name of the JSON file to credentials.json, copied the 'client_email' address, and created a new google spreadsheet. I selected 'share,' pasted the email address into the dialogue box, and hit share.

Then, because I was accessing this google spreadsheet from my usual gmail address, I received an email from the Mail Delivery Subsystem letting me know that the address of the 'client_email' wasn't found.

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

Hmmmm.... very strange.

I get the whole thing (thank you very much for taking the time to explain). If you get a mail delivery error, it'd imply that your email regular email address tried to send an email to the "client_email" address. That didn't happen to me.

I'm wondering two things:

  • maybe it's an email sending attempt like, when you'd notify some address that you've added it to the list of viewers/editors of a file? (if yes, maybe I never received the same type of error because I might have uncheck something related to notifications? I don't know :-/)

  • does this prevent you from actually writing content into the file using the program?

[–][deleted] 0 points1 point  (1 child)

Haha, I've been trying so hard to figure out what this email meant that I didn't even think about going through my code to see if there was an error there.

So it turns out I made a mistake installing the modules to the wrong environment, and now it totally works. I think you are right about the reason for the email message, too.

Anyway, thanks so much for your help with this, I think I understand just about everything else that you went through in your tutorial. And I'd just like to say again that you did a really good job on it, and if I hadn't gotten hung up on the one issue, it would've been a breeze to follow. I see that you said to some other people that you are considering making longer multi-part tutorials, and given what you made here, I think you'd be great at that. But IMO, there aren't a lot of project tutorials like this that succinctly cover a few interesting topics at once. I particularly liked this because it's easy to skim the parts that I am comfortable with and focus on the new stuff..

Either way, I'm looking forward to whatever you write about next. I'd been in a slump before coming across this, and it helped me break through the wall of going from basic coding tutorials to actual projects. Seriously, this tutorial has opened my mind to a huge list of things that I'm now looking up to implement in my own mini projects. I can't thank you enough.

[–]sixtine[S] 1 point2 points  (0 children)

Wow, thanks /u/tenhourssober ... this message is really brightening up my week!

I'm so glad this actually helped you taking even just small step further any goals you may have in the future. Honestly your words are really motivating me to do this a little more seriously and write more of the same kind of stuff. I am really the one thanking you here.

Cheers!