/ Published in: ColdFusion
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<cfset evernote = "http://www.evernote.com/shard/s3/pub/253263/khoyt/blog/rss.jsp?max=25&sort=2&search="/> <cfset util = new Utility()/> <cfhttp url="#evernote#"/> <cfset doc = XmlParse( evernote )/> <cfset items = XmlSearch( doc, "//item" )/> <cfset entries = ArrayNew( 1 )/> <cfloop index="sub" from="1" to="#ArrayLen( items )#" step="1"> <cfset entry = StructNew()/> <cfset success = StructInsert( entry, "source", "Evernote" )/> <cfset success = StructInsert( entry, "title", items[sub].title.XmlText )/> <cfset success = StructInsert( entry, "link", items[sub].link.XmlText )/> <cfset success = StructInsert( entry, "description", items[sub].description.XmlText )/> <cfset success = StructInsert( entry, "published", util.ParseRSSDate( items[sub].pubDate.XmlText ) )/> <cfset success = StructInsert( entry, "guid", items[sub].guid.XmlText )/> <cfset start = Find( "##", entry.guid ) + 1/> <cfset entry.guid = Mid( entry.guid, start, Len( entry.guid ) - start + 1 )/> <cfset success = ArrayAppend( entries, entry )/> </cfloop> <cfset util.SaveEntries( entries )/> Done.