Grails Feeds Plugin Error


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



Copy this code and paste it in your HTML
  1. def broadcastInstance = Broadcast.findByUid(params.broadcast)
  2. if(broadcastInstance){
  3. def episodes = Episode.findAllByBroadcastAndReleaseDateLessThan(broadcastInstance,new Date(),[sort:'releaseDate',order:'desc',max:10])
  4. def url = "http://${request.getHeader('host')}${grailsApplication.parentContext.servletContext.contextPath}/${broadcastInstance.uid}"
  5.  
  6. render(feedType:"rss", feedVersion:"2.0") {
  7. title = "${broadcastInstance.title} (Episodes)"
  8. link = "${url}/rss"
  9. description = "${broadcastInstance.longDescription}"
  10.  
  11. iTunes {
  12. summary = "${broadcastInstance.longDescription}"
  13. keywords = "${broadcastInstance.keywords}"
  14. categories = [ "${broadcastInstance.genera}" ]
  15. image = new URL(g.createLinkTo(dir:"images/${broadcastInstance.uid}",file:'poster.png',absolute:true))
  16. author = "Lifeforce TV"
  17. subtitle = "${broadcastInstance.shortDescription}"
  18. ownerName = "Lifeforce Entertainment"
  19. ownerEmailAddress = "[email protected]"
  20. }
  21.  
  22.  
  23. Episode.findAllByBroadcastAndReleaseDateLessThan(broadcastInstance,new Date(),[sort:'releaseDate',order:'desc']).each{ episode ->
  24. entry(episode.title) {
  25. title = episode.title
  26. link = "${url}/episode/${episode.uid}"
  27.  
  28. //enclosure(type: 'audio/mp3',
  29. // url: episode.fileUrl,
  30. // length: episode.fileLength)
  31. enclosure(type: 'audio/mp3', url: 'woot', length: 0)
  32. publishedDate = episode.releaseDate
  33.  
  34. // do the itunes Meta
  35. iTunes {
  36. author = broadcastInstance.attribution
  37. summary = episode.longDescription
  38. durationText = episode.runningTime
  39. try{
  40. keywords = episode.split(",")?.remove(0)
  41. }catch(e){
  42. keywords = []
  43. }
  44. explicit = episode.explicit
  45. }
  46.  
  47. content(episode.longDescription)
  48.  
  49. }
  50. }
  51. }
  52. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.