How to code google-services.json file (download link broken)? - json

Although I have analytics account, signed in with chrome when attempting to download etc. the famous link to download the generated file is broken.
So - How can I configure it by myself? This should be proper simple code task...:
Create new .json file in your project and what to put inside? Google's documentation assumes the link always works and I'm struggling to find instructions on how to code this file by myself.
Thanks,

Related

What is the internal file format of a .glink file?

I would like to add URL links into a web-based Google Drive folder. Searching online, it appears that this was once possible with files that ended in a .glink extension. I'm looking for documentation on the file format so that I can create them programmatically.
[EDIT] Why do I want to create .glink files? Because I want links (bookmarks, URLs) to be able to appear in my Google Drive web page and to be able to click on them an go to the page. Microsoft OneDrive supports this functionality.
GLINKS Files
The URL link file feature was available due to a workaround with Back Up and Sync before being deprecated with Drive for Desktop. The .glink seems to be patched and no longer available as it was also part of a third party tool no longer available. It seems it now only saves them as .URL and automatically gives it the icon for Google Docs, as it would take it as a simple file with text.
Checking the .url type file of Windows, when uploading to Drive it does not update as it should, even utilizing Drive for Desktop (as an alternative to sync data like back up and sync) the outcome is the one suggested above.
This is the main reason why there is no longer any documentation about the matter, due to this one not being an official feature and being also fully deleted, it can be confirm by the file type available when creating files with the Drive API:
https://developers.google.com/drive/api/guides/ref-export-formats
I would suggest to request a feature to allow this or to provide a new way to store URL links as before or report it to review if possible any references on how it used to work by submitting a feature request or checking the issue tracker about the matter:
https://issuetracker.google.com/issues/new?component=191650&template=824106
You can also add the details of the previous threads or discussions about the GLINKS.

Downloading files from Drive using alt=media with correct filename

I'm having trouble allowing files (non-shared) to be downloaded from a Google Drive account. I've created a listing using the php drive sdk and would like to provide authorised links to download the files using a generated access token. I've got downloads working with links like this:
https://www.googleapis.com/drive/v3/files/[fileid]?alt=media&access_token=[access_token]
The problem is that whenever a file is downloaded, it is named [fileid].[extension], rather than the real file name that appears in Drive.
I've tried adding the download="[real filename]" into the a link to suggest the correct filename, but it's being ignored in all the browsers I've tried.
I've got an alternative working that gets the file piece by piece server side and echoes it out as a file via php, but I'd prefer for downloads to be straight from Drive to the user.

How to edit HTML in Google Drive?

I have hosted a HTML file created on my PC (along with a stylesheet) on Google Drive using the script described here.
I have given out the link and it seems to be working fine (no reported issues from those I've sent it to).
I have just discovered a minor omission from the file, I need to add another sentence. This should be ridiculously easy on a PC, I could just open it on notepad!
I can't find a way to edit it on Google Drive, the only connected apps are the viewer and Docs.
The viewer, as the name suggests, will only let me view the HTML, and the docs app won't let me save it back to the original file.
Obviously I could download it then upload again, but from experience it will probably give me a different URL.
Is there any way for me to do this while keeping the link the same, as I have already given the address out?
Currently you can't. You can only preview html files, that is preview the code or preview the rendered content, but you cannot natively edit the code. You have two options:
use a third party extension, such as Neutron Drive or Drive Notepad.
install the Google Drive Desktop App, edit your files locally and save. Changes will be uploaded automatically.
I have just used HTML Editey chrome app
You can do this through file revisions. Hopefully, Google adds another way, but using the revision feature works for me. To revise your file, click the check mark in the Google Drive file list, click more, and then click "Manage revisions...". In the box that pops up, click upload new revision and then you're set.
You may also be able to edit html files stored in google drive through other plugins, but I do not use any at this time to know of them.
Update!
go to drive right click your html file
choose "open with" then "connect more apps"
when app library pop up search for "notepad" then choose "drivenotepad"
after it connect to drive, select it, you will get code editor.

Is is possible to get a permanent URL to a file uploaded to Google drive?

I can't find the answer to this in the API docs or elsewhere. I see in the docs says you can get a downloadURL of a file, but it refers to it as a 'short lived URL'. What does that mean?
I need to upload images and get a permanent URL of that image that is the direct URL than can be embedded into emails or web docs etc. Is that possible?
Thanks
Yes, you can get a permalink to any file hosted on Google Drive in a public folder. Just note the folderID:
and paste it to the following URL:
http://googledrive.com/host/<folderID>/<filename>
or you can create a short custom alias using G Drives: http://gdriv.es/<alias>/<filename>
https://developers.google.com/drive/v2/reference/files#webContentLink
downloadUrl is short lived, but webContentLink is a permanent link. It's odd that one is a URL and the other is a "link", but I guess it probably has to do with the additional query params in the strong. Maybe that makes it not just a URL? :)
That property is only available for files that are publically readable, so you may have to use the SDK/API to set the permissions first.
In case someone encounter the same problem and don't want to do with deprecated Google Drive solution above and requires frequently changed files with exact same url, you can use Dropbox. Steps:
Download the program and share a folder (tutorial)
Copy a file into that folder; wait for sync with Dropbox
Go to your dropbox.com account
Share your file by button, get something like:
https://www.dropbox.com/s/d28d8scvr3rfy48/foo.exe?dl=0
Rename it to:
https://dl.dropboxusercontent.com/s/d28d8scvr3rfy48/foo.exe?dl=0
Now you have a public, unchanged url for all your foo.exe changes.
Enjoy, don't waste time with sites offering you file hosting and they change the URL for same files.
If you share a file publicly in GDrive, you can use the following link to make the file download directly:
https://drive.google.com/uc?export=download&id=FILEID
The problem happens when you want to change the file (for version controlled download, in instance) and keep the same downloading link.
You can use a URL Shortener like bitly.com and use a Branded Bitlink to change the destination URL keeping the input URL.
I hope it works, good luck!
It seems if you have file ID you can access it with such url:
https://drive.google.com/open?id=file-id-here
If file is public, you'll see it immediately but if not, you're be asked to login
I don't know how often this changes but I was looking for a dynamic solution where I wouldn't need to manually upload to another site and the provided solutions weren't working.
Here's the url that worked for me:
https://lh3.google.com/u/0/d/<file_id>
Where file_id is the getId() using the google apps script drive API. Secondly the file must be shared publicly like posted previously
Secondly I imagine the lh3 are different cdn's though I cannot confirm since lh1/2 don't work and everything higher than 3 redirects to lh3
I don't know if such API for google drive exists, but I think you should also have a look at dropbox,
which will meet all the demands that you mention in your question.
Also there are some very cool applications developed just for dropbox, like pancake.io which lets you share links of text, html files, in an html page format.
that + permanent link is always there.
You can use gdriveurl.com, it got updated and now allows users to log in with their google drive account and share the list of files instantly, getting for each file "View" & "Download" short permalink.
There's also the old solution (login to Google Drive, set everything to "Public on web", copy share link, convert it into the gdriveurl.com textarea in the homepage), but it's just a waste of time, you should try "MyDrive" api.
Not sure if the link generated here is guaranteed to be permanent, but Google Drive Direct Link Generator does the job of generating a direct download link.
Just make sure your file's sharing setting is set to Anyone with the link

What directory do I put my Spotify apps in on Vista?

I'm trying to develop apps for Spotify using their API. I started using this guide of theirs but got stuck quickly when it said to put my files in "My Documents/Spotify". Vista uses the folder Documents instead of My Documents (and if you try to create My Documents inside your user folder, it merges the contents into Documents), so I'm having trouble getting Spotify to find my apps.
I created folder "hurrdurrdurr" inside C:\Users\myusername\Documents\Spotify\, and put the HTML and JSON files described here inside of C:\Users\myusername\Documents\Spotify\hurrdurrdurr\, but "spotify:app:hurrdurrdurr" gave me a "metadataFailed" message with "Error:appNotFound". Any ideas where I should be putting my app files?
And yes, all of the following things have happened:
I have made my account a developer account
The "Develop" tab has appeared in Spotify
I have tried restarting Spotify after putting the app in the directory
Also, I'm using Spotify version 0.8.3.222.{build ID that I'm too lazy to copy}. I can't find a download link for any preview build, but this is the latest version as far as I can tell. Anyone
The directory should be correct, in my case it is C:\Users\buchetics\Documents\Spotify. Something is probably wrong with your app. Check out the example/tutorial here:
https://github.com/mager/spotify-apps-tutorial
I just cloned the repository and it works with the same Spotify version you are using.
After having a similar problem with getting the Spotify tutorial to load into Spotify on my Windows machine, I figured out what the issue was-- it's very simple. I'm not going to claim this will resolve every issue but a lot of people who are using Windows based machines seem to be running into this issue.
1.Once you download the Spotify tutorial from github, extract it to the folder you've created-- as stated on the github site the folder should be "Spotify".
You can place the "Spotify" folder where ever you please as long as it's on the C: drive (Desktop, My Documents, etc).
Open the "Spotify" folder; then open the "apps-tutorial-master" folder-- within this folder is a folder with a similar name "apps-tutorial-master", cut all the files from within this folder and move them up to the parent of this folder and paste them.
"Spotify"->"apps-tutorial-master"->"apps-tutorial-master"->"THE FILES WE NEED TO MOVE UP ONE DIRECTORY";
The new directory structure should look like:
"Spotfy"->"apps-tutorial-master"->"THE FILES WE MOVED UP ONE DIRECTORY;
Once you've cut and paste the files up one directory you should then be able to get Spotify to load the tutorials. The redundancy in the folder structure comes from the extraction/unzipping by the windows utility.
I hope this helps those who are using a Windows machine.