Skip to content

Instantly share code, notes, and snippets.

@emres
Created February 9, 2013 21:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save emres/4747124 to your computer and use it in GitHub Desktop.
A very short Scala program that I have created to process my wordpress blog's imported XML file to detect the gist URLs
import xml.XML
object ProcessBlog extends App {
val myBlog = XML.loadFile("fzblogs.wordpress.2013-02-08.xml")
for (item <- (myBlog \\ "item")) {
val indexOfGist = item.text.indexOf("//gist")
if (indexOfGist > 0) {
println((item \\ "guid").text + " " +
item.text.substring(indexOfGist, indexOfGist + 53))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment