Replace the json files with google sheets

As it is easier to update the site information with a google sheet than using a JSON file. I’m trying to use a google sheet to update the site information @jaye @Gravewalker

3 Likes

I used the google sheet instead of using the JSON files to load data to the site. So I tested it with the Onelive page locally and it worked!!!

After editing and saving the google sheet it auto-updates the same URL and gives the new data to the site

jsontest1

Also can add new profiles or delete them with the google sheet

jsontest2

Here is the google sheet link - https://docs.google.com/spreadsheets/d/1XQI7aOokHIzbpoA5cyC5xum7EJA3tv599QUNds-d6HQ/edit?usp=sharing

URL of the JSON format - https://script.google.com/macros/s/AKfycbwEurJtUIJ6i3jAafwuZ2bfX4VaUKYB_anvCtyV7hZV-6q-QIhEwZd7N6zHsAfAG-LJ/exec

I haven’t created an Issue & PR for this. So is there anything to improve or shall I create the Issue & PR :smiley: @EngTeam

3 Likes

@Gajindu_Bandara Awesome work dude! This is really impressive :100: I guess you used your personal email to create these sheets. @akshika47 @jaye Should we use the SEF email to create these sheets so that anyone with edit access could update the site easily?

I did some tests to find out the loading time of the google sheet URL. It takes about 1.0s to 1.3s time to load the data to the website
Screenshot from 2021-06-22 11-33-32
@EngTeam

1 Like

Thank you @Gajindu_Bandara for the update. @jaye @akshika47 Since this takes about 1 sec to load, should we lookup for an alternative or apply this anyway?

1 second seems reasonable.

How about trying with like 500 mock rows?

Btw, images should be uploaded to a separate place and post the url on that field. Otherwise we have to open a pr to upload images. (The intention of this task is to update data without opening prs)

1 Like

We can add a loading icon right? In case it took more than that to load.

Yeah I’ll try it by uploading the image to the drive and using that link to access the image

Latency seems okay to me! We have to be methodical and put in checks for images being uploaded via Google Drive. the other issue would be the size of images that could impact the loading time and the Google Drive storage.

I used the google photos service to upload an image and got the URL. Using that URL I imported the profile picture to the website. It’s working accurately! So is there anything to be changed or improved?

Also, I came up with an idea, we have to update the profile images from time to time as the person is not going to be the same. So for that, we can use the LinkedIn profile picture and when the person is updating his profile picture it will automatically update the website profile image as well :smiley:

@akshika47 @EngTeam

1 Like

Good job! @Gajindu_Bandara. Correct me if I’m wrong. So basically we do have 2 options here.

  1. Using LinkedIn profile image URL directly to the google sheet.
  2. Using google photos to upload the profile image and add the generated URL to the google sheet.

I checked if there is a Linkedin API to get the profile image by name. But unfortunately, they don’t unless authentication is provided. Therefore if we choose option 1, we need to manually visit the person’s profile, then copy the profile image URL. Also, I noticed whenever someone changes his/her profile image, their URL changes too. Therefore, If we choose option 1, we have to manually change the URL each time someone changes their profile picture. If Linkedin provides an API to achieve this, we can later move to this option.

I know it’s not the best option. But for now, I think it is better to go with google photos at this point. We do have all the photos we need. All we need is some time to upload and document them. At least it’ll be solid once it’s done.

WDYT? :grinning_face_with_smiling_eyes: @akshika47 @EngTeam

Reference: https://stackoverflow.com/questions/6955647/getting-linkedin-profile-picture

1 Like

Good analysis @Gimhan_minion! I agree with your reasoning and I prefer the second option as it is more stable.

1 Like

Yeah! @Gimhan_minion LinkedIn thing is gonna be a problem when the person is changing the picture. I just figured that out later :sweat_smile:
I did some further tests with google photos on the Onelive page, So is it OK to use the google photos service or should I look for another alternative image hosting service :thinking: @akshika47 @EngTeam

2 Likes

@Gajindu_Bandara We’ll go with google photos for now!

Then shall I create an issue and a PR for this google sheet thing? @Gimhan_minion

1 Like

Yeah, go ahead! @Gajindu_Bandara :hugs:

Created a PR for this google sheet thing (https://github.com/sef-global/sef-site/pull/985) :grin:

I used google photos to upload the images but @jaye said about the image resizing thing and I found that feature on the https://postimages.org/ site.
Screenshot from 2021-06-28 15-55-30
We can create a gallery and we can select the image size as well. So no need to resize the images manually before uploading as in google photos. But there are some terms and conditions as we have to use a free account in it.

Screenshot from 2021-06-28 15-55-39

So which option are we gonna use @EngTeam ? :thinking:

@Gajindu_Bandara Can you check cloudinary? I think it meets our requirements. It has this image resize API and the free tier seems enough for us. https://cloudinary.com/cookbook/resize_an_image

Yeah! I’ll check that @anjisvj :smiley:

I created an account at https://cloudinary.com and uploaded the images on the Onelive page to that. :grin:

Screenshot from 2021-06-29 10-36-53

I didn’t use the resizing functions for the existing image because they are in the correct format. As @anjisvj said, images can be resized from that website. So I’m gonna move from google photos to this Cloudinary image hosting service. I added the Cloudinary image links to the google sheet and updated the sheet

Screenshot from 2021-06-29 10-37-28
So what next ? are we gonna use this service? :thinking: @EngTeam

1 Like