I'm uploading some images to our GDrive account (via API) so I can publish them in our webapp.
I like to post thumbnailLink because of the =s parameter where you can scale the image to a desire width.
But now I've found a problem:
everytime I make a file get request (https://developers.google.com/drive/v2/reference/files/get) the thumbnailLink changes its value
This problem raises two questions:
Why does this happen?
Is there anyway I can keep the same thumbnailLink and make it
work forever?
edition: in file documentation (https://developers.google.com/drive/v2/reference/files) says that only downloadUrl has a short lived value
The thumbnail URL is also short lived (as some simple testing revealed). I'll work with the documentation team to also have this noted in the documentation.
Related
I found out i can get Summoner Icon image using this url:
https://ddragon.leagueoflegends.com/cdn/11.14.1/img/profileicon/934.png
The basic form of this is:
https://ddragon.leagueoflegends.com/cdn/{version}/img/profileicon/{profileIconId}.png
i know i can get the second value of {profileIconId} through Riot API but how do i know when i should update the version value? I don't want my app to crash when the version should be changed.
You should not be referencing ddragon for displaying icons or images. In fact, DataDragon specifically requests that you download the archive (.tgz) for each patch/version and host the assets locally or on your own CDN.
Websites like op.gg do this for all of the assets and host the images on their own CDN. They have to update their CDN every patch. You can automate updating the CDN using scripts, but for most small projects the work to automate this process may not be worth it.
Generally, it is considered rude to piggyback off of someone else's CDN without explicit permission to do so. Riot goes a step further and explicitly asks that you do not do this.
If someone is using the data dragon (ddragon) cdn, you can know the latest version looking at this json that they provide:
https://ddragon.leagueoflegends.com/api/versions.json
Just take the first element of the array and you are good to go without any scripting.
I have a Slack channel that I send an image to on a daily basis from a third party service.
The issue is that they do not change the image url so it is always:
http://website.com/image.url
even though the image itself changes, as in it shows different information.
In Slack it recognises the URL and changes all the previous days image to match today.
I tried adding a query to the end of the image eg:
http://website.com/image.url?timestamp=12345678
but Slack is clever enough to ignore that.
Does anybody know of a way to get around this other than make a copy of the image and save it as a different URL?
Thanks.
Slack probably caches the image, either locally on your device or on their servers (the former seems more likely). You might want to try fully closing and reopening Slack if you haven't already. Several other questions describe different behavior (i.e., Slack dynamically retrieving the image so that it is updated to reflect the newest version), so this may be due to something they have changed or a temporary issue on their end. I would try refreshing and/or logging out and back in again, then re-uploading the image if this doesn't work.
Ive created a simple slack command that calls a rest api. The api simply returns some json with an image url.
This all works great in slack, but Ive noticed each time you view the image in slack it re-calls the image url.
This image is a live screenshot of one of our servers, if someone in slack views an old image (from a previous day) the screenshot is from now and not then.
Can this be stopped ? or am I better using webhooks ?
This is normal behavior for images URLs. Slack might cache it for some time, but it will ultimately always retrieve the newest version assuming it is the same image.
However, your image is changing over time. So while it has the same URL the content is changing.
To freeze the image at the time of the request you need to make time based snapshots and give them individual names / URLs. You can do this by creating a copy of that image each time the slash command is called and return a link to that copy. e.g. by uploading it to imgur.com or any other image server. You can also use Slack for this by the way (see this answer)
I'm working on a Joomla website, which has a set of documents that needs to displayed using a Google Docs viewer.
Though only Authenticated users can reach the file, but the file can also be access through direct path like http://www.example.com/files/somefile.pdf even without authentication.
So when i tried to view a file through Google Viewer with a link something like this..
http://docs.google.com/viewer?url=http://www.example.com/files/somefile.pdf
The files which are of size less than 100kb are viewable and for rest all an error message is displayed as:
Sorry, it took too long to find the document at the original source. Please try again later.
You can also try to download the original document by clicking here.
So I'm not sure whether this is something to do with the Google Doc Viewer, Joomla or any Server issue for request timeout.
How can I make each file irrespective of size viewable with Google Docs?
If its PDF only, you can also just use pdfjs from Mozilla directly. Then you should check your URL encoding. If the issue remains, check out https://code.google.com/p/google-api-php-client/ for converting your docs in-place. Opening them with pdfjs is still recommended to bypass Google-Doc-Viewer problems, at least that is how I could get this working properly.
I have shared a Google Docs folder with our remote team and a few members of my team. Is it possible to send out emails to all collaborators/viewers when a document is uploaded or edited in the folder?
Otherwise it becomes difficult to keep track of whether anything was changed or not.
Thanks.
Yes! Check out the Google Documents List Data API. Basically, you post a signed request to the API requesting specific documents or a list of documents overall and Google responds with an Atom feed of the documents that you're looking for. Among the tags is <updated>, which contains the timestamp of the last modification. If you keep a local listing of files handy, you can compare to see if any revisions were made.
Also interesting in the feed is <published>, which describes when a doc was created. If you know the last time you checked for updates, any docs published after that time can be considered newly created.
I'm not going to get into code (doesn't sound like what you're asking for), but this should get you on the right track. Hope it helps!
Yes and no.
Google Docs is not a consistent set of tools, so notifications are supported but only partially.
Google Spreadsheet has a set notification rules in the Tools menu
Google Form is linked to spreadsheet so they're covered too
You would have to do something yourself for Document/Word and Presentation apps
I would suggest reading the document from web and checking if the checksum was changed