0

When I share a link to a Google Drive folder on Reddit, Twitter, etc., those sites will crawl the link looking for meta tags in the html. The meta tags tell the site how to represent the link in a preview. For example, a Wall Street Journal article page will contain a number of meta tags aimed at Twitter, which are intended to show a preview title, synopsis, and image to show a user more context than just a raw URL:

<meta name="twitter:title" content="Landmark Settlement in Cartoonish Harassment Case" />
<meta name="twitter:description" content="Snow White and The Seven Dwarves came to an agreement today to settle their long-standing court battle over whether the phrase 'Hi-Ho' constitutes sexual harassment. Yes, I made this up for the sake of the StackExchange post." />
<meta name="twitter:image" content="https://images.wsj.net/im-123456789/social" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image:alt" content="SW&T7D Call it Quits" />
<meta name="twitter:site" content="@WSJ" />
<meta name="twitter:domain" content="wsj.com" />

My trouble is, I want a Google Drive folder to come with enough metadata for Twitter, Reddit, etc., to render a preview for the link. I see that there are some third-party plug-ins that were intended to do this, but I don't want to be telling the people who will be posting these links to install such things. It's a terrible habit to trust plugins on your storage applications. Does Drive have a way to accomplish this?

1

Google Drive, including the Google Apps Script Drive Service and the Google Drive API haven't built-in features to add HTML meta-tags.

As you don't want to rely on plug-ins it's very likely that your best bet is to look into the Social Media apps for tools to customize the posts made on them. I.E. Facebook has a Graph API. They also offer Graph API Explorer. To use it you will have to use a tool that allows to set your HTML meta-tags including the link to the file thumbnail / preview, for this you might use Google Apps Script to publish a web application.

Resources

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.