Skip to content

Instantly share code, notes, and snippets.

@behrangsa
Created December 25, 2013 05:30
Show Gist options
  • Save behrangsa/8120420 to your computer and use it in GitHub Desktop.
Save behrangsa/8120420 to your computer and use it in GitHub Desktop.
A handy script to cleanup my Delicious bookmarks
package org.behrang.deliciouscleaner
@Grab(group = "net.sf.delicious-java", module = "delicious", version = "1.14")
import del.icio.us.Delicious
def d = new Delicious("username", "password")
def posts = d.allPosts
posts.eachWithIndex { p, i ->
println (i+1) + "/" + posts.size()
tag = p.tag
hasUppercase = tag.any { s -> Character.isUpperCase s.charAt(0) }
if (hasUppercase) {
tags = tag.split(" ").collect({ t -> t.toLowerCase() }).join(" ")
p.tag = tags
d.addPost(p.href, p.description, p.extended, p.tag, null, false, p.shared)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment