04 May 2016

How to Copy an Entire Folder to Another Folder in Google Drive


Google Drive, launched almost 4 years ago, is an online vault where you can store all your files and documents. It offers nearly all the functionality that you would expect in a file manager app making it easier for you to manage files from within the browser. You can move files between folders, rename files, differentiate them with colors, add text notes for easier lookup and more.

However the one piece that is still missing in Google Drive is the ability to copy folders. You can duplicate any file in Google Drive by right-clicking the file and selecting “Make a Copy” but this option is not available for folders. A Google Script exists to copy folders in Google Drive but it is complicated.

The option to duplicate folders doesn't exist in Google Drive

The option to duplicate folders doesn’t exist in Google Drive

How to Copy Folders in Google Drive

Wouldn’t it be nice if there were an xcopy (Windows) or rsync (Mac, Unix) like command for Google Drive that would recursively copy everything inside a folder, easily It should not only copy all the files and subdirectories but also retain the directory tree structure and maintain the shared file permissions.

Well, we are not sure if Google will ever provide an option to duplicate folders in Google Drive but there’s an open source web app by Eric YD that does exactly what you are looking for. Here’s how to get started:

  1. Go to labnol.org/xcopy and click the Authorize button.
  2. Allow the app to access your Google Drive files. The app would perform the copy operation directly inside your Google account without involving a third-party server.
  3. Once authorized, select the source folder using the Google File picker and specify the destination folder name.
  4. Click the Copy Folder button to begin the cloning process.

That’s it. The script will run in the background and copy files, one-by-one, into the target folder.  It will log everything in a Google Spreadsheet so you know what’s happening behind the scene.

While optional, the app can also retain permissions and in the case the copied files will be editable/viewable by the same people as the original files. The copying process would however take longer if you choose to copy the sharing permissions.

Also see: Add Files in Google Drive to Multiple Folders

Copy Folders to another Google Drive Account

Say you have a folder in one Google account (A) that you would like to copy to another Google account (B). While the app doesn’t support copying across accounts, there’s a simple workaround:

  1. Use labnol.org/xcopy to copy the folder in its original account (A).
  2. Log into account B, create a blank folder and share it with account A.
  3. Log into account A and move the copied folder into the shared folder.
  4. Go back to account B and remove the sharing permissions for the folder.

The Alternative – If you are not comfortable giving access to your Google Drive to another app, you can manually copy folders using the Google Drive desktop client for Windows and Mac. Go to Windows Explorer (or Finder), select the source folder and press Ctrl+C followed by Ctrl+V to duplicate the folder.

This would however not retain the original file permissions. The other downside is that Google Drive will have to reupload all the copied files whereas in the previous case, the copying happened on Google servers directly.


The story, How to Copy an Entire Folder to Another Folder in Google Drive, was originally published at Digital Inspiration by Amit Agarwal on 03/05/2016 under Google Drive, Internet.

03 May 2016

How to Embed Facebook Message Buttons in your Website


Email has always been the preferred mode for reaching out to people on the Internet. Websites would put their email addresses on web pages and made them clickable hyperlinks using the mailto protocol. Things have changed and while email is still considered important, the new generation is known to prefer instant texting apps like Facebook Messenger over email. For them, writing an email is as boring as creating a résumé.

This step-by-step guide explains the various techniques that you can use to easily embed the Facebook Messenger button in your website. When someone clicks the Message Me button, it will directly launch the Facebook Messenger app on their mobile phone or the messenger.com website if they are on the desktop. You can choose to receive messages in your Facebook profile or your Facebook page, if you have one.

A: Simple Facebook Messenger Link

The default Facebook Messenger button is rendered using JavaScript but you can also write them in pure HTML without requiring JavaScript. The advantage is that these buttons (see demo) would show up even if the user has enabled ad blockers and second, you can embed message links inside email newsletters.

Facebook Messenger

All you have to do is replace “XYZ” in the snippet below with your Facebook vanity username. If you don’t have a username yet, you can use your numerical Facebook profile ID instead. The link may be customized with CSS to resemble a button as seen in this live demo.

 <a href="http://ift.tt/1X6i2yP;
    Message us on Facebook
 </a>

Tip: If you are not seeing messages sent to your Facebook profile, it is because Facebook automatically hides messages from people that are not in your contacts / friends list. Go to http://ift.tt/1hby4Cb, click the “More” dropdown and choose “Filtered” to see all messages that are not in your main inbox.

B: Facebook Messenger Button

This is the default Facebook Messenger button (see live demo) rendered with JavaScript. Unlike the previous option that allows messaging to personal profile as well, this button is only available to Facebook Page owners for them to receive messages from other Facebook users.

To get started, copy-paste the following snippet in your blog template but remember to replace “XYZ” with the numeric ID of you Facebook Page. You can set the color as white for a blue text on white background button.

<script>      
      window.fbAsyncInit = function() {
        FB.init({
          appId      : '95100348886',
          xfbml      : true,
          version    : 'v2.6'
        });
      };

      (function(d, s, id){
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) {return;}
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/en_US/sdk.js";
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));      
    </script>

    <div class="fb-messengermessageus" 
         messenger_app_id="95100348886" 
         page_id="XYZ" 
         color="blue"
         size="large">
    </div>

Tip: If you are unable to use the Facebook Messenger button, it is likely that your Facebook Page is configured to not receive messages. Go to your Facebook Page settings, choose General, Messages and turn on the option that says “Allow people to contact my Page privately by showing the Message button”.

C: Facebook Messenger Box

You have seen the Facebook Like box embedded in websites but did you know that the same box can also include an inline form allowing any Facebook user to contact you without even leaving your webpage. Here’s a live demo.

In this case you need to replace “XYZ” in the snippet below with the vanity username or ID of your Facebook Page. Anyone who is logged into Facebook can message you from your website itself, similar to regular contact us forms.

<script>
      window.fbAsyncInit = function() {
        FB.init({
          appId      : '95100348886',
          xfbml      : true,
          version    : 'v2.6'
        });
      };

      (function(d, s, id){
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) {return;}
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/en_US/sdk.js";
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));
    </script>

    <div class="fb-page" 
         data-href="http://ift.tt/1TI9vyZ; 
         data-tabs="messages" 
         data-width="400" 
         data-height="300" 
         data-small-header="true">
      <div class="fb-xfbml-parse-ignore">
        <blockquote></blockquote>
      </div>
    </div>

You should also check the Facebook Page Plugin to learn about all the other configuration options that can be easily set using the data attributes.

Related: How to Embed Facebook Posts in Webpages


The story, How to Embed Facebook Message Buttons in your Website, was originally published at Digital Inspiration by Amit Agarwal on 03/05/2016 under Code, Embed, Facebook, Internet.

02 May 2016

How to Delete the Useless Photos in your WhatsApp Automatically


WhatsApp is probably the largest space hog on our mobile phones. We all have friends and relative who diligently forward us every single motivation quote and meme they’ve received from their own network. Some think it is their duty to wake us with a “good morning” message accompanied with photos of the rising sun or chirping birds.

The bigger problem with WhatsApp is that these ‘spam’ messages often originate from contacts who are close to you in real life and thus blocking them would be considered rude. You have an option to mute WhatsApps groups but the downloaded images would still take up precious space on your mobile phone.

A simple solution to the problem would be that you open the Photo Gallery app on your Android phone, or use a File Manager app to locate the media folder of WhatsApp, and delete the entire folder containing those WhatsApps images. But since WhatsApp makes no distinction between real photographs and useless forwards, you risk deleting the good pictures too.

Are junk WhatsApp images filling up your phone's memory?

Are junk WhatsApp images filling up your phone’s memory?

Siftr, an Indian startup founded by ex-Adobe employees, has launched an intelligent Android App that can help you get rid of all the junk photos from your WhatsApp with no effort.

The app, Magic Cleaner, scans the media folder of your WhatsApp app and automatically detects all the junk images including screenshots, memes, video screen grabs, cartoons and other pictures with overlay text. You are then offered an option to delete all the detected images in one go.

Previous: Create Photography Websites with Siftr

How does it work? Like Cloud Vision, Google’s image recognition API, Siftr has developed their own image recognition engine that analysis the content of an image to determine whether it’s junk or not. It requires an active Internet connection because the image analysis is done on Siftr servers and not locally on the mobile phone. However it is unlikely to blow up your data plan as the app only uploads a small hash of the image and matches it against their own database of images.

I ran the photo cleaner app against a WhatsApp account that had about 4000+ images and it could successfully clean it up in about 10 minutes. The accuracy was very impressive. The app is free but you can only auto-delete a limited number of images in a single run. If you would like to delete more images, you either need to invite a friend to use the app or wait for a day.

WhatsApp Photo Cleaner

If you have WhatsApp, which you probably do, Magic Cleaner is a must-have app. An iPhone version is in the works. Also, though the WhatsApps images are deleted from the memory card, a blurred thumbnail will still exist inside your WhatsApp message logs and you’ll have to erase them manually.

Also see: Sync WhatsApp Photos with Google Drive or Dropbox


The story, How to Delete the Useless Photos in your WhatsApp Automatically, was originally published at Digital Inspiration by Amit Agarwal on 02/05/2016 under Android, WhatsApp, Internet.

01 May 2016

Automatic Translation in Google Search


If you search for a word in a foreign language, Google now automatically shows the translation. For example, you can search for [amanecer] to get the English translation of the Spanish word, instead of typing [translate amanecer] or [translate amanecer to english].


This only works for words, and some expressions, not for longer texts. It works for [buenas noches], but not for [buenas noches señora], so you'll still have to search for [translate buenas noches señora] or [buenas noches señora to english].