Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation of the Google Contacts API (June 15, 2021) #176

Closed
3ter opened this issue May 20, 2021 · 31 comments · Fixed by #177
Closed

Deprecation of the Google Contacts API (June 15, 2021) #176

3ter opened this issue May 20, 2021 · 31 comments · Fixed by #177
Assignees

Comments

@3ter
Copy link

3ter commented May 20, 2021

Are there any plans to migrate the project to use the new Google People API?

I couldn't find any active fork as well.

@plainerman
Copy link
Collaborator

I would also be highly interested in this, and willing to assist if needed!

@skoelle
Copy link

skoelle commented Jun 7, 2021

I am interested too, being using this script for years and was soo happy to stop using my own ugly c# tool
pls make it happen someone tries to migrate it

@plainerman
Copy link
Collaborator

Since there has not been any response, I'll try to look into it over the next few days (ideally before June 15th). I will keep you posted in this thread.

Hopefully only minor changes are necessary - otherwise I won't have enough time right now.

@WmOne
Copy link

WmOne commented Jun 7, 2021

thanks so much, im' interested too.

@calebsidel
Copy link

While I find the script hard to understand, I love it and have been using it for years too! Thank you to all the contributors for making this awesome script and hopefully People API-ing it!

@plainerman
Copy link
Collaborator

So I am currently investigating this issue and found the place where the contacts API is used:

googleContact = ContactsApp.getContactById('http://www.google.com/m8/feeds/contacts/' + encodeURIComponent(settings.user.googleEmail) + '/base/' + encodeURIComponent(contactId));

The good thing is, I tried a bad URL to see what happens when the API returns errors (at least I think that this causes an equivalent control flow) and the script works just fine without the contacts API.

The only thing different is that there will be no profile picture, phone number etc. in the mail. But the names will still be printed. At least for me, this is everything I need.

As of now, I am a bit overwhelmed by the People API and Google Scripts. Let's see if I get the hang of it...

@3ter
Copy link
Author

3ter commented Jun 9, 2021

That's great to know. So the main functionality only stems from using the calendars provided by the respective account.

calendarId = CalendarApp.getAllCalendars().filter(function (cal) {

For me it would be fine too without pictures and all the other sugar.

@skoelle
Copy link

skoelle commented Jun 9, 2021

Wow thats great to hear. Yes the pictures never been something I needed. I thought the contacts API is used for more.

@plainerman
Copy link
Collaborator

plainerman commented Jun 9, 2021

So, I found out it is not only the mail addresses / phone numbers etc. that are missing but also the age (which I quite like).

Anyways, I was able to fully include the new People API and also update to the new Chrome V8 runtime (that will probably be the default soon).

I am too tired now... I will try to push this tomorrow or the day after.

The owner of this repository does not seem active anymore.
Do you want me to create a PR, or a fork? I believe a fork would be better as this allows me to update the readme pages etc. even without a merge.

But I would love to know what you (the community) thinks.

@3ter
Copy link
Author

3ter commented Jun 10, 2021

In the light of other already ignored pull requests I'm in favor of a fork. You could also appoint other contributors to be able to review and merge pull requests to reduce your workload.

@WmOne
Copy link

WmOne commented Jun 10, 2021

if the author seems not to be active, maybe a fork is better. a PR in that case will remain unseen (and unworked).

of course, if you make a fork, you should let the users know (in the mail sent by the script) the new location of the code.

This is only my opinion.

@GioBonvi
Copy link
Owner

Hi everyone: I'm the owner of this repository.

This script was originally born as a simple hack to provide for notifications and it autonomously grew into something a lot more complex thanks to a lot of contributions from the community. Unfortunately as you have already noted, in the last years I have not had the time to properly maintain this project.
I hoped for GCEN to be able to survive without a lot of maintenance (and it actually seems to have done it quite well until now), but it looks like things have finally caught up.

I'd like to hear what you all think the best route could be:

  • if there is anyone willing to contribute and to take up a maintainer role I will gladly give access to this repo in order to fix this issue and the backlog of PRs(I can also consider transferring ownership, but I don't know the implications for existing users: would it be seamless? Would they have to refer to a new URL?)
  • if noone can pick this up I can try and find some time to implement some last changes during this weeks, after which I'll mark the repository as currently unmantained (possibly adding a notice in the email text as well)

Thank you all

@plainerman
Copy link
Collaborator

plainerman commented Jun 10, 2021

Thanks @GioBonvi for your response!

I cannot guarantee how much time I will have, but I would love to become a maintainer and (at least) push the migration to the new API (and look at an issue here and there). The code is done, I only have to update the documentation and maybe add a wiki page for migration (as the new API has to be added).

As far as I know, transferring the ownership leaves the old links in tact (All links to the previous repository location are automatically redirected to the new location. Source).
But I think for this step we should wait until this project becomes really active (by some maintainer).

@lukeoconnell
Copy link

Thank you @GioBonvi for putting this out there in the first place. I can't tell you how useful it is. Thanks to @plainerman for volunteering to become a maintainer, I can't wait until we can try it out!

@plainerman
Copy link
Collaborator

So when I tried to create the PR, I found out that I worked on version 4 of the script (instead of 5).
This means, it will take a few days until I come around to test the new changes in the new version.

@WmOne
Copy link

WmOne commented Jun 29, 2021

Hello everybody.
Are there any news about the topic ?

@plainerman
Copy link
Collaborator

Yes, sorry. I was busy the last two weeks. I hope to finalize it this weekend.

@plainerman
Copy link
Collaborator

So I created the draft PR #177 that will resolve this issue.
With my settings it works, but before you can use the updated code, you have to integrate the people API.

When I find the time, I will update the documentation and keep you update in this thread. Probably next week.

Maybe someone of you could test the change and documentation (once it is written) before I merge the PR.

@plainerman plainerman self-assigned this Jul 6, 2021
@lukeoconnell
Copy link

Amazing, I can't wait for the documentation - thanks @plainerman!

@plainerman
Copy link
Collaborator

Maybe someone of you could try out PR #177. @GioBonvi suggested that we might not need to include the people API.
More info in PR #177.

@plainerman
Copy link
Collaborator

Anyone volunteering?

@3ter
Copy link
Author

3ter commented Aug 3, 2021

Anyone volunteering?

Thanks for the reminder @plainerman . I've tried it but ran into syntax errors so I suppose I need some help to copy it correctly to script.google.com.

@plainerman
Copy link
Collaborator

plainerman commented Aug 3, 2021

@3ter thank you very much for trying it out.

While I don't know if it changes anything could you do the following steps:

  1. Go to the script
  2. Click the gear icon on the left hand side
  3. Enable Chrome V8-Runtime

@GioBonvi do you happen to remember if you ever needed v8 features? Or if there is an easier way to activate this setting (e.g. as a line in the script)?

@3ter
Copy link
Author

3ter commented Aug 3, 2021

Yes, you're correct. I've just pieced that together as well but it's good to have it recorded here for others 👍

EDIT: I've now tried it out and it worked like a charm. I'm keeping your changes @plainerman . Thanks for the effort!

@plainerman
Copy link
Collaborator

plainerman commented Aug 3, 2021

@3ter Great, thank you!
Did you also try a test mail? Because I believe it could break when contact info is fetched.

EDIT: Probably I will rewrite the code, such that we do not need v8

@3ter
Copy link
Author

3ter commented Aug 3, 2021

That's exactly what I've tested. I've got the mail as expected and the log showed that too:

8:12:02 PM	Info	I: Building the email notification.
8:12:02 PM	Info	I: Sending email...
8:12:02 PM	Info	I: Email sent.
8:12:03 PM	Notice	Execution completed

@lukeoconnell
Copy link

Hi, thanks @plainerman everyone for your continued work on this. Is it ready for use do you think, or is more testing required?

@3ter
Copy link
Author

3ter commented Aug 23, 2021

I'm using it heavily and so far nobody claimed I've forgot them 😅. As the "installation" is only a matter of minutes I recommend joining in.

I'll leave it to the PR to close this issue.

@plainerman
Copy link
Collaborator

Sorry, life is kinda busy right now. I will try my best to finish it this week.

The code is already working, but I have to rewrite a bit so that it works with the old javascript runtime.

@plainerman
Copy link
Collaborator

I finalized the code so that copy-pasting the new code should be enough without changing any of the settings.

Since this is my first PR, I will wait till I merge the changes until one of you confirms that it works. Would you @lukeoconnell have time for that? Or anybody else?

@lukeoconnell
Copy link

@plainerman excellent work -

Ahead of updating the code, I disabled the Contacts API and enabled the People API.

I then updated the code and ran notifStop / Start and using the test function was able to generate a successful message with a test contact. The email was received.

Thanks for much for the contribution, I think you can push this now. Oh and thank you @GioBonvi for the original branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants