Posts

Showing posts with the label parser

Sort table of links with Tablesorter jQuery plugin

Assuming you have a table of links (link a portal) in your website like the following: <table class="tablesorter" id="tbl1"> <thead> <tr> <th> Faculty </th> </tr> </thead> <tbody> <tr> <td><a href="#link1">A link</a></td> </tr> <tr> <td><a href="#link2">G Link</a></td> </tr> <tr> <td><a href="#link3">H Link</a></td> </tr> <tr> <td><a href="#link4">B Link</a></td> </tr> <tr> <td><a href="#link5">K Link</a></td> </tr> <tr> <td><a href="#link6">U Link</a></td> </tr> <tr> <td><a href="#link7">C Link</a></td> </tr...

Google Drive API - Rename duplicate files / folders

Here are the case: You create an empty document. You forgot to name the file and just close the window after typing something. The file will stay in your Google Drive with the name " Untitle Docutment ". You repeat that action some other times. You will end up having so many duplicate files (or folders) in your Google Drive with the same name. ... Someday you will (I will) need to re-organize all the documents and folders in your Drive account. The first thing to do is to rename all the duplicate files or folders by modified date. The newest file will have the name (e.g. "My document"), and the older files will have number after the name ("My document (1)", "My document (2)",...) The following snippet I wrote to do the renaming task and make the world alot easier: from dateutil import parser def rename_file (service, file_id, new_title):     """Rename a file.     Args:     service: Drive API service instance.    ...