-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path15-all.cfc
36 lines (32 loc) · 1.35 KB
/
15-all.cfc
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
component extends="../BaseTask" {
function getFeedData( feed ){
print.redLine( ">> Thread: #getThreadName()# ").toConsole();
print.greenLine( "Getting feed: #arguments.feed#" ).toConsole()
cffeed( action="read", source=feed, properties="local.properties", query="local.data" )
print.greenLine( "* Finished feed: #arguments.feed#" ).toConsole();
if ( isStruct( local.properties.title ) && local.properties.title.keyExists( "value" ) ) {
local.properties.title = local.properties.title.value;
}
return {
"title" : local.properties.title,
"items" : local.data.reduce( ( result, row ) => {
result.append( row.title )
return result;
}, [] )
}
}
function run(){
var feeds = [
() => getFeedData( "http://feeds.feedburner.com/raymondcamdensblog" ),
() => getFeedData( "https://feeds.transistor.fm/modernize-or-die-podcast-cfml-news-edition" ),
() => getFeedData( "https://www.ortussolutions.com/blog/rss" ),
() => getFeedData( "http://feeds.bbci.co.uk/news/world/rss.xml" )
];
asyncManager
.all( feeds )
.get()
.each( ( feed ) => {
print.redLine( "Feed: #feed.title#" ).toConsole();
} );
}
}