I am trying to create a freebase acre application which can keep track of certain users records and export the mql query output to Google Docs.
Is it possible to export mql query output to Google Docs in acre?
Edit #1
I found out this doc by which i can export data to Google Docs using javascript.
Edit #2
I am able to upload files to drive but i need to create a Spreadsheet with it. Could it be possible?
This is possible using Google Drive SDK. I am successful in exporting the query output but not able to share the code here.
If you can export the results as CSV, you can create a Google Spreadsheet with them. The important point is to remember to set:
convert=true
Query parameter on insertion which will ensure that your file is converted correctly to a GOogle Spreadsheet.
Related
I'm trying serach in a drive for driveItems. I have figured out how to search for driveItems in the API like this:
https://graph.microsoft.com/v1.0/sites/{siteId}/drives/{driveId}/search(q='test')
But for my application, I need more detailed information about the documents so I tried to use the $expand without any successful outcome.
Request to look up more details about a single driveItem:
https://graph.microsoft.com/v1.0/sites/{siteID}/drives/{driveId}/items/{itemId}/listItem/?expand=fields($select=Title,ID,etc..)
Is it possible to achieve all the fields I get from this request when I use the $expand parameter in Search for DriveItems within a drive? Or do I need to look up every single driveItem to get the additional parameters?
What I have tried:
https://graph.microsoft.com/v1.0/sites/{siteId}/drives/{driveId}/search(q='test')?expand=fields($select=id,title,etc..)
According to my research and testing, unfortunately, when I use the following graph api:
https://graph.microsoft.com/v1.0/sites/{site-id}/drives/{drive-id}/items/{item-id}/?$expand=fields($select=id)
I got the error:
"message": "Parsing OData Select and Expand failed: Could not find a property named 'fields' on type 'microsoft.graph.driveItem'."
If you want to use the $expend parameter, I suggest you use the following Graph API:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/?$expand=fields($select=id)
The google sheets API documentation states I need to have a sheetID that would show up in the url here (denoted {SHEETID}):
https://docs.google.com/spreadsheets/d/{SHEETID}/edit#gid=0
However, when I publish to the web, the URL returned is something along the lines of:
https://docs.google.com/spreadsheets/u/1/d/e/2PACX-1vcasfsaf2123Mt_basdf34grGd_1231sfak_D32141sfasfqwer_phealsjsmfdafcmr2S_-n-wzUp/pubhtml
I have also already tried just using the sheetID from the unpublished url and that does not work either.
I'm trying to pull data with react from this sheet but am unable to do so. Does anyone know how else I can get the sheetID?
How can I get the storage usage of Gmail programmatically? This value appears in two places, but I cannot find an API for it.
The main goal is to automatically log Gmail storage usage to a Google Sheet and graph the storage usage trend.
What I've tried:
DriveApp.getStorageUsed() does not include Gmail usage.
Reports API (gmail_used_quota_in_mb) is not available for consumer Gmail accounts (only G Suite)
Scraping www.google.com/settings/u/0/storage is not possible because a log-in is required, even when spoofing cookies (probably detects a new device/IP address).
Not the programmatic answer I am looking for, but this is my manual work-around until I discover an API method:
Examine the source code for google.com/settings/u/0/storage
Find exact bytes of usage embedded in JSON:
...
,[["Drive",["24004828","0.02 GB"]
]
,["Gmail",["4859735562","4.52 GB"]
]
,["Google Photos",["0","0 GB"]
...
Log that (4,859,735,562) into a Google Sheet, along with the current date/time
Using precise measurements of bytes and seconds, it should only take a few measurements to get an accurate trend. (And I don't need to scale this for multiple accounts.)
You can use Google Drive V2 API.
About: get returns quotaBytesByService[] where you can filter service by name (e.g. GMAIL, in your case)
If you want to use the API, you have to enable the advance API option and use it.
Note that the version 3 does not give you the service breakdown.
I am in the process of creating an app using the Google Maps api to generate random biking routes (http://sutsurikeru.com/maps) and it works fine so far, but the issue I am having is passing the generated route, including the following info to the google maps app:
Start Destination
Way-point (randomly generated using https://gis.stackexchange.com/questions/25877/how-to-generate-random-locations-nearby-my-location)
End Destination (same as the start destination)
Once I've got all the lat/long information I pass it to a button that is created when the route is generated so that it can pass the route to the Google Maps App, but I am unsure how to pass the way-point as there is no mention of it in the docs - https://developers.google.com/maps/documentation/ios-sdk/urlscheme
$('#goRide').append('<a class="goridebtn" href="comgooglemaps://?saddr=' + address + '&daddr=' + address + '&directionsmode=bicycling">Go ride</a>');
I guess my question is then, can I include the way-point information when I am passing it to the Google Maps App?
i couldn't find the answer for that too , so i ended using:
"comgooglemapsurl" instead..
this way you can pass a full url (same onese used in the browser)
the format will be something like this:
comgooglemapsurl://www.google.com/maps/dir/STARTING_POINT/WAYPOINT_1/WAYPOINT_2/WAYPOINT_3/WAYPOINT_4/DESTINATION
you can add as many points as u wish
comgooglemapsurl://www.google.com/maps/dir/24.848607,46.660478/24.748607,46.760478/24.778607,46.784478
https://developers.google.com/maps/documentation/urls/ios-urlscheme
Looks like you can add waypoints using the +to: variable inside the daddr text. The following example shows this in use:
comgooglemapsurl://?saddr=55.852866,-4.323120&daddr=56.019015,-3.372803+to:55.972934,-3.279419+to:55.932952,-3.284912+to:56.022085,-3.565063
I tried more but i did not find the exact doc plz share any idea to implement google calendar dynamically and that can be share to user for edit and view.
I found this PHP Quickstart guide in Google Calendar API documentation. It provides steps on how to integrate a simple PHP command-line application that makes requests to the Google Calendar API. This might help.
You can view the calendar by calling the calendarList.get method. It returns an entry on the user's calendar list. See the example:
$calendarListEntry = $service->calendarList->get('calendarId');
echo $calendarListEntry->getSummary();
Then you can Edit/Update an entry on the user's calendar list by calling calendarList:update method. Example:
$updatedCalendarListEntry = service->calendarList->update($calendarListEntry->getId(), $calendarListEntry);
echo $updatedCalendarListEntry->getEtag();
Check the GitHub examples below:
https://github.com/montania/Google-Calendar-API-PHP-Class
https://github.com/google/google-api-php-client/blob/master/src/Google/Service/Calendar.php