Created
June 4, 2011 03:04
-
-
Save behrangsa/1007517 to your computer and use it in GitHub Desktop.
Delicious Cleaner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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