Skip to content

Instantly share code, notes, and snippets.

@behrangsa
Created June 4, 2011 03:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save behrangsa/1007517 to your computer and use it in GitHub Desktop.
Save behrangsa/1007517 to your computer and use it in GitHub Desktop.
Delicious Cleaner
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