Proper Method for Google Calendar with PHP - php

I am working on a website for my organization which will allow users of the website to create/modify/etc room reservations for a number of spaces in our building.
Each room has a Google Calendar which links to several monitors around the building to display what rooms are [un]available. So, my goal was to utilize these calendars by having the website I am creating edit these google calendars. The problem I am having however is that from all the documentation I have been able to find, it looks like you have to prompt each user for Google Log-In. This is what I am trying to avoid. I want individuals to be able to log-in to my website, and then on the backend my website provides the authentication to Google so that they can add/edit/remove events from the aforementioned GCals based on permissions on set on their account.
Can anyone help direct me to the proper documentation? I've found a couple of things through some intensive Google-ing of my own, but I've become extremely confused about what method I should be using.
Any assistance in getting things rolling is appreciated!

If I understand it correctly, the concept that you want is to create a website that writes into your own calendar and not on the users calendar. Exactly what this 3 part tutorial of Sample Web Page for Booking gives:
Part 1: Setting up Google Calendar
Part 2: OAuth2 and Configuring Your ‘Application’ With Google
Part 3: A Sample Web Page For Bookings
This tutorial worked for many like what has been done in this SO post - How do I connect to the Google Calendar API without the oAuth authentication?.

Related

Card Data/fetcher/ previewer API configuration for a php website on Magic the Gathering

I would define myself as a junior PHP developer (as have written small scripts occasionally). A week ago I started a new project to make a website for magic the gathering (card game) where users write and publish their articles on the game or tournaments.
Normally it wouldn't be a problem because if there is any external source, it could by hyperlinked and the problem is solved.
But in this case in articles users have to discuss about MTG cards, upload decklists and stuff like that and can't put hyperlinks for these things and neither create a database for all cards as only 3 months new cards are published with new set release.
What I am looking for is a 3rd party code integration into my project where user typing a string such as "[card_data]NAME OF CARD[card_data]" have a card preview by clicking on it.
There are several websites like:
https://www.mtggoldfish.com/articles/instant-deck-tech-five-color-birds-modern
https://www.channelfireball.com/all-strategy/articles/
and several other website.
I couldn't try anything because I don't know the procedure to call an API in php script, tutorials on youtube, or w3schools are very simple and often they are about facebook and google apis .
There are websites that have APi available for mtg cards data such as https://docs.magicthegathering.io/
https://scryfall.com/docs/api
https://www.echomtg.com/api/
But I am missing the part of integration them in my website.
I would like to have something like in this example where "Wasteland" is a card and by hovering on it or clicking on it there should be a card preview:
Of course, the easiest way to make Wasteland useless is never to play any land at all
I found a really easy and simple solution to the problem above. I'll use tooltips of https://deckbox.org/help/tooltips

Google calendar reminders

I have a Laravel 5 project and I create event on google calendar with larvael-google-calendar.
I need to create reminder but not reminder of an event (so not the notifications to remind an event). The reminder you can create on Google calendar.
This :
Which look like this after created :
And not this
But I don't find anything on it, when I research I always find results concerning the reminder like a notification.
Anybody know how to create it with the API or another method (PHP of course)? (I don't care if I need to remove my package, just want a solution).
I have actually looked around for this for a long time. This is the conclusion i have come to.
The reminders you are speaking of arnt actually part of Google Calendar they are more part of your full Google account as far as i have been able to tell.
You can for example create a reminder though the Google assistant, Google Calendar android app and the Gmail android app as far as i have seen so far.
It appears that this works across multiple applications there for IMO this is not directly part of Google calendar and thats why we cant seem to find an option for adding remainders from within the Google Calendar api.
I think we will have to wait for Google to release a new API for this.

Simplest way to get data from Google Analytics?

I am building a service like Wix.com, users can build simple mutli-pages website with ease. Every website will be including in a global Google Analytics account with a unique profile, then the tracking code is to be placed in the website pages.
Now, on the website dashboard i want to show the online visitors and the total number of visists for the website for each website separatly, trying to do so i have :
Tried using GAPI (http://code.google.com/p/gapi-google-analytics-php-interface/) but due to Google Analytics major update it doesn't work anymore.
I found Google Core reporting API for Analytics, but i believe it's made for 3rd party applications that accesses GA data for their clients, meaning that the user should have a Google account and GA profile for the website, and the App just connects to the account and retrieves data. And this of course isn't the case here; i can't ask the user to create a Google account and embed the tracking code in the website HTML; else what am i here for ?
Got the picture ? I need the simplest method to do this, no fancy stuff.
PS: Minutes ago i found this: Google Analytics Query Explorer (http://ga-dev-tools.appspot.com/explorer/), it's a 3rd party app that builds custom queries for GA and gives you the link, something like that :
https://www.googleapis.com/analytics/v3/data/ga?ids= (the ID) &dimensions=ga%3AvisitCount&metrics=ga%3Avisitors&segment=gaid%3A%3A-1&start-date=2013-02-01&end-date=2013-02-23&max-results=50
Now, trying to access the URL (thinking; this is easy :) ) the respond is a request for login first :
{"error":{"errors":[{"domain":"global","reason":"required","message":"Login Required","locationType":"header","location":"Authorization"}],"code":401,"message":"Login Required"}}
Thanks in advance.
Unless you have fewer than 50 clients this plan is not going to work the way you're asking for. (There is a limit of 50 profiles per account.)
The client will have to make their own GA number and provide it to you as a setting for their website.
In order to display the customers reports on a dashboard on your site you're also going to have to get them to authorize a GA App you create for access.

Creating a Google Calendar remotely

I've been researching this question for the last few weeks and have had no success trying to connect to Google through OAuth1 OR 2.
I have a client that needs a separate Calendar for each of the homes they are building. On creation of a new home in the database, I want to create a calendar and save the Id of the created calendar.
What options do I have to do this?
It seems like the only way is to have the user get redirected to Google and login to add a calendar... I want to use a static Google account and simply create the calendar that way, without having the annoying "Login to google" screen.
Google api lets you to do whatever you need with a Calendar using their provided libraries. Let's take a look: Google Developer: Instantiate Google Calendar
This SO posts discusses that. Specifically pay attention to the line in the accepted answer where it is mentions the process for adding a new calendar is similar to adding an event.
SO: Google Calendar API Selecting and creating Calendars
I also came across this tutorial which may be helpful in terms of other actions on the calendar once it has been created.
IBM Developer Works: Integrate your PHP Application with Google Calendar

Is there any good totuiral to facebook API and is it possible to get the friends list of the user in my site?

I want to build a website that you can login with your facebook account.
what tutorial or any good beginner's book is there on this issue.
Is there any good sample of source code for this use
can I get the friends lists of my users and split it to males and females?
what is the difference between GRAPH and Facebook API?
Facebook have a few methods for integrating facebook in websites, check out the Facebook for Websites tutorial.
You have a few ways to implement this using the tools facebook provides you with, for example you can use the Registration Plugin (you can find code & examples in this tutorial).
If you have a facebook application and a user authorizes your app, then you can get the list of his friends. Without asking for specific permissions though all you will get is the their names/facebook ids. If you need more than that check out the Permissions documentation (2nd column refers to the friends).
Both things are the same, you just gave them different names.. It's called the Graph Api, there's no other "facebook api". This graph api also supports FQL in case the api alone is not enough for what it is you need.

Categories