Posted By

parkerkrhoyt on 12/27/10


Tagged

parse rss feed content read evernote ever note


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

digitaloffice


Read and Parse an Evernote RSS Feed


 / Published in: ColdFusion
 

  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  

You need to login to post a comment.