-
Notifications
You must be signed in to change notification settings - Fork 1
/
podcast.json2xml.coffee
68 lines (62 loc) · 1.99 KB
/
podcast.json2xml.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
fs = require 'fs'
convert = require('data2xml')();
shows = require './'+process.argv[2]
title = "Above & Beyond: Group Therapy"
podcastUrl = "http://static.aboveandbeyond.nu/grouptherapy/podcast.xml"
author = "aboveandbeyond.nu"
link = "http://www.aboveandbeyond.nu/radio"
summary = "Group Therapy is the weekly radio show from Above & Beyond also known as ABGT"
language = "en"
name = "Above & Beyond"
copyright = "Above & Beyond"
email = "[email protected]"
imageUrl = "http://tatw.co.uk/Group_Therapy_Podcast_600x600.jpg"
category = "Music"
keywords = ["abgt", "group therapy", "above & beyond", "above and beyond", "anjuna", "anjunabeats", "anjunadeep", "oceanlab", "tranquility base"]
explicit = "no"
podcast =
_attr:
"xmlns:itunes": "http://www.itunes.com/dtds/podcast-1.0.dtd"
version: "2.0"
"xmlns:atom": "http://www.w3.org/2005/Atom"
channel:
"atom:link":
_attr:
rel: "self"
href: podcastUrl
type: "application/rss+xml"
lastBuildDate: 0
title: title
"itunes:author": author
link: link
"itunes:subtitle": null
"itunes:summary": summary
language: language
copyright: copyright
"itunes:owner":
"itunes:name": name
"itunes:email": email
"itunes:image":
_attr:
href: imageUrl
"itunes:link":
_attr:
rel: "image"
type: "video/jpeg"
href: imageUrl
_value: title
category: category
"itunes:category":
_attr:
text: category
"itunes:keyword": keywords.join ","
"itunes:explicit": explicit
item:
shows.map (show) ->
show.enclosure =
_attr: show.enclosure
return show
xmlPodcast = convert "rss", podcast
html = require 'html'
console.log html.prettyPrint xmlPodcast,
indent_size: 2