Skip to content

Instantly share code, notes, and snippets.

@swbuehler
Created February 12, 2014 00:06
Show Gist options
  • Save swbuehler/8947169 to your computer and use it in GitHub Desktop.
Save swbuehler/8947169 to your computer and use it in GitHub Desktop.
WordPress XML to Evernote Items
tell application "System Events"
set rssFeed to XML file "Mac mini HD:Users:steven:Downloads:stevenwbuehler.wordpress.2014-02-09.xml"
set rssItems to every XML element of XML element "channel" of XML element "rss" of contents of rssFeed whose name is "item"
repeat with thisItem in rssItems
set theTitle to the value of XML element "title" of thisItem
set thepubDate to the value of XML element "pubDate" of thisItem
set theContent to the value of XML element "content:encoded" of thisItem
tell application "Evernote"
create note notebook "Blog Temp" with html theContent title theTitle created date (do shell script "date -j -f '%a, %d %b %Y %H:%M:%S %z' " & quote & thepubDate & quote & " '+%A, %B %d, %Y at %r'")
end tell
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment