Created
February 9, 2013 21:08
-
-
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
This file contains hidden or 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
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