Read and Parse an Evernote RSS Feed


/ Published in: ColdFusion
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <cfset evernote = "http://www.evernote.com/shard/s3/pub/253263/khoyt/blog/rss.jsp?max=25&sort=2&search="/>
  2. <cfset util = new Utility()/>
  3.  
  4. <cfhttp url="#evernote#"/>
  5. <cfset doc = XmlParse( evernote )/>
  6. <cfset items = XmlSearch( doc, "//item" )/>
  7. <cfset entries = ArrayNew( 1 )/>
  8.  
  9. <cfloop index="sub" from="1" to="#ArrayLen( items )#" step="1">
  10.  
  11. <cfset entry = StructNew()/>
  12.  
  13. <cfset success = StructInsert( entry, "source", "Evernote" )/>
  14. <cfset success = StructInsert( entry, "title", items[sub].title.XmlText )/>
  15. <cfset success = StructInsert( entry, "link", items[sub].link.XmlText )/>
  16. <cfset success = StructInsert( entry, "description", items[sub].description.XmlText )/>
  17. <cfset success = StructInsert( entry, "published", util.ParseRSSDate( items[sub].pubDate.XmlText ) )/>
  18.  
  19. <cfset success = StructInsert( entry, "guid", items[sub].guid.XmlText )/>
  20. <cfset start = Find( "##", entry.guid ) + 1/>
  21. <cfset entry.guid = Mid( entry.guid, start, Len( entry.guid ) - start + 1 )/>
  22.  
  23. <cfset success = ArrayAppend( entries, entry )/>
  24.  
  25. </cfloop>
  26.  
  27. <cfset util.SaveEntries( entries )/>
  28.  
  29. Done.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.