|
<Query Kind="Program"> |
|
<Namespace>System.Threading.Tasks</Namespace> |
|
</Query> |
|
|
|
async Task Main() |
|
{ |
|
var p = new Podcast(); |
|
p.Title = "Zephaniah Lectures (Fall 2015) - Jason DeRouchie"; |
|
p.Description = "Jason DeRouchie teaches through Zephaniah to his adult Sunday School class at Bethlehem Baptist Church in Fall 2015."; |
|
p.FeedUrl = "https://gist.github.com/jpoehls/b85b800e364358d93ac7a4a4e746d3db/raw/feed.xml"; |
|
p.LinkUrl = "https://jasonderouchie.com/derouchie-zephaniah-audio-lectures/"; |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 1 - Zeph 1:1", |
|
Description = @"Week 1 - Zephaniah 1:1 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-1-Zeph-1v1.pptx |
|
|
|
Zephaniah 1:1 |
|
The word of the Lord that came to Zephaniah the son of Cushi, son of Gedaliah, son of Amariah, son of Hezekiah, in the days of Josiah the son of Amon, king of Judah. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/11/Zephaniah-Wk1.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 2 - Zeph 1:2-6", |
|
Description = @"Week 2 - Zeph 1:2-6 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-2-Zeph-1v2-6.docx |
|
|
|
Zephaniah 1:2-6 |
|
“I will utterly sweep away everything |
|
from the face of the earth,” declares the Lord. |
|
“I will sweep away man and beast; |
|
I will sweep away the birds of the heavens |
|
and the fish of the sea, |
|
and the rubble with the wicked. |
|
I will cut off mankind |
|
from the face of the earth,” declares the Lord. |
|
“I will stretch out my hand against Judah |
|
and against all the inhabitants of Jerusalem; |
|
and I will cut off from this place the remnant of Baal |
|
and the name of the idolatrous priests along with the priests, |
|
those who bow down on the roofs |
|
to the host of the heavens, |
|
those who bow down and swear to the Lord |
|
and yet swear by Milcom, |
|
those who have turned back from following the Lord, |
|
who do not seek the Lord or inquire of him.” |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/11/Zephaniah-Wk2.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 3 - Zeph 1:7-13", |
|
Description = @"Week 3 - Zeph 1:7-13 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-3-Zeph-1v7%E2%80%9313.pptx |
|
|
|
Zephaniah 1:7-13 |
|
Be silent before the Lord God! |
|
For the day of the Lord is near; |
|
the Lord has prepared a sacrifice |
|
and consecrated his guests. |
|
And on the day of the Lord's sacrifice— |
|
“I will punish the officials and the king's sons |
|
and all who array themselves in foreign attire. |
|
On that day I will punish |
|
everyone who leaps over the threshold, |
|
and those who fill their master's house |
|
with violence and fraud. |
|
|
|
“On that day,” declares the Lord, |
|
“a cry will be heard from the Fish Gate, |
|
a wail from the Second Quarter, |
|
a loud crash from the hills. |
|
Wail, O inhabitants of the Mortar! |
|
For all the traders are no more; |
|
all who weigh out silver are cut off. |
|
At that time I will search Jerusalem with lamps, |
|
and I will punish the men |
|
who are complacent, |
|
those who say in their hearts, |
|
‘The Lord will not do good, |
|
nor will he do ill.’ |
|
Their goods shall be plundered, |
|
and their houses laid waste. |
|
Though they build houses, |
|
they shall not inhabit them; |
|
though they plant vineyards, |
|
they shall not drink wine from them.” |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/11/Zephaniah-Wk3.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 4 - Zeph 1:14-18", |
|
Description = @"Week 4 - Zeph 1:14-18 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-4-Zeph-1v14-18.pptx |
|
|
|
Zephaniah 1:14-18 |
|
The great day of the Lord is near, |
|
near and hastening fast; |
|
the sound of the day of the Lord is bitter; |
|
the mighty man cries aloud there. |
|
A day of wrath is that day, |
|
a day of distress and anguish, |
|
a day of ruin and devastation, |
|
a day of darkness and gloom, |
|
a day of clouds and thick darkness, |
|
a day of trumpet blast and battle cry |
|
against the fortified cities |
|
and against the lofty battlements. |
|
|
|
I will bring distress on mankind, |
|
so that they shall walk like the blind, |
|
because they have sinned against the Lord; |
|
their blood shall be poured out like dust, |
|
and their flesh like dung. |
|
Neither their silver nor their gold |
|
shall be able to deliver them |
|
on the day of the wrath of the Lord. |
|
In the fire of his jealousy, |
|
all the earth shall be consumed; |
|
for a full and sudden end |
|
he will make of all the inhabitants of the earth. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/11/Zephaniah-Wk4.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 5 - Zeph 2:1-4", |
|
Description = @"Week 5 - Zeph 2:1-4 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-5-Zeph-2v1-4.pptx |
|
|
|
Zephaniah 2:1-4 |
|
Gather together, yes, gather, |
|
O shameless nation, |
|
before the decree takes effect |
|
—before the day passes away like chaff— |
|
before there comes upon you |
|
the burning anger of the Lord, |
|
before there comes upon you |
|
the day of the anger of the Lord. |
|
Seek the Lord, all you humble of the land, |
|
who do his just commands; |
|
seek righteousness; seek humility; |
|
perhaps you may be hidden |
|
on the day of the anger of the Lord. |
|
For Gaza shall be deserted, |
|
and Ashkelon shall become a desolation; |
|
Ashdod's people shall be driven out at noon, |
|
and Ekron shall be uprooted. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/11/Zephaniah-Wk5.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 6 - Zeph 2:5-15, Part 1", |
|
Description = @"Week 6 - Zeph 2:5-15, Part 1 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-6-Zeph-2v5-15-pt1.pptx |
|
|
|
Zephaniah 2:5-15 |
|
Woe to you inhabitants of the seacoast, |
|
you nation of the Cherethites! |
|
The word of the Lord is against you, |
|
O Canaan, land of the Philistines; |
|
and I will destroy you until no inhabitant is left. |
|
And you, O seacoast, shall be pastures, |
|
with meadows for shepherds |
|
and folds for flocks. |
|
The seacoast shall become the possession |
|
of the remnant of the house of Judah, |
|
on which they shall graze, |
|
and in the houses of Ashkelon |
|
they shall lie down at evening. |
|
For the Lord their God will be mindful of them |
|
and restore their fortunes. |
|
|
|
“I have heard the taunts of Moab |
|
and the revilings of the Ammonites, |
|
how they have taunted my people |
|
and made boasts against their territory. |
|
Therefore, as I live,” declares the Lord of hosts, |
|
the God of Israel, |
|
“Moab shall become like Sodom, |
|
and the Ammonites like Gomorrah, |
|
a land possessed by nettles and salt pits, |
|
and a waste forever. |
|
The remnant of my people shall plunder them, |
|
and the survivors of my nation shall possess them.” |
|
This shall be their lot in return for their pride, |
|
because they taunted and boasted |
|
against the people of the Lord of hosts. |
|
The Lord will be awesome against them; |
|
for he will famish all the gods of the earth, |
|
and to him shall bow down, |
|
each in its place, |
|
all the lands of the nations. |
|
|
|
You also, O Cushites, |
|
shall be slain by my sword. |
|
|
|
And he will stretch out his hand against the north |
|
and destroy Assyria, |
|
and he will make Nineveh a desolation, |
|
a dry waste like the desert. |
|
Herds shall lie down in her midst, |
|
all kinds of beasts; |
|
even the owl and the hedgehog |
|
shall lodge in her capitals; |
|
a voice shall hoot in the window; |
|
devastation will be on the threshold; |
|
for her cedar work will be laid bare. |
|
This is the exultant city |
|
that lived securely, |
|
that said in her heart, |
|
“I am, and there is no one else.” |
|
What a desolation she has become, |
|
a lair for wild beasts! |
|
Everyone who passes by her |
|
hisses and shakes his fist. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk6.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 7 - Zeph 2:5-15, Part 2", |
|
Description = @"Week 7 - Zeph 2:5-15, Part 2 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-7-Zeph-2v5-15-pt2.pptx |
|
|
|
Zephaniah 2:5-15 |
|
Woe to you inhabitants of the seacoast, |
|
you nation of the Cherethites! |
|
The word of the Lord is against you, |
|
O Canaan, land of the Philistines; |
|
and I will destroy you until no inhabitant is left. |
|
And you, O seacoast, shall be pastures, |
|
with meadows for shepherds |
|
and folds for flocks. |
|
The seacoast shall become the possession |
|
of the remnant of the house of Judah, |
|
on which they shall graze, |
|
and in the houses of Ashkelon |
|
they shall lie down at evening. |
|
For the Lord their God will be mindful of them |
|
and restore their fortunes. |
|
|
|
“I have heard the taunts of Moab |
|
and the revilings of the Ammonites, |
|
how they have taunted my people |
|
and made boasts against their territory. |
|
Therefore, as I live,” declares the Lord of hosts, |
|
the God of Israel, |
|
“Moab shall become like Sodom, |
|
and the Ammonites like Gomorrah, |
|
a land possessed by nettles and salt pits, |
|
and a waste forever. |
|
The remnant of my people shall plunder them, |
|
and the survivors of my nation shall possess them.” |
|
This shall be their lot in return for their pride, |
|
because they taunted and boasted |
|
against the people of the Lord of hosts. |
|
The Lord will be awesome against them; |
|
for he will famish all the gods of the earth, |
|
and to him shall bow down, |
|
each in its place, |
|
all the lands of the nations. |
|
|
|
You also, O Cushites, |
|
shall be slain by my sword. |
|
|
|
And he will stretch out his hand against the north |
|
and destroy Assyria, |
|
and he will make Nineveh a desolation, |
|
a dry waste like the desert. |
|
Herds shall lie down in her midst, |
|
all kinds of beasts; |
|
even the owl and the hedgehog |
|
shall lodge in her capitals; |
|
a voice shall hoot in the window; |
|
devastation will be on the threshold; |
|
for her cedar work will be laid bare. |
|
This is the exultant city |
|
that lived securely, |
|
that said in her heart, |
|
“I am, and there is no one else.” |
|
What a desolation she has become, |
|
a lair for wild beasts! |
|
Everyone who passes by her |
|
hisses and shakes his fist. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk7.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 8 - Zeph 3:1-7", |
|
Description = @"Week 8 - Zeph 3:1-7 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-8-Zeph-3v1-7.pptx |
|
|
|
Zephaniah 3:1-7 |
|
Woe to her who is rebellious and defiled, |
|
the oppressing city! |
|
She listens to no voice; |
|
she accepts no correction. |
|
She does not trust in the Lord; |
|
she does not draw near to her God. |
|
|
|
Her officials within her |
|
are roaring lions; |
|
her judges are evening wolves |
|
that leave nothing till the morning. |
|
Her prophets are fickle, treacherous men; |
|
her priests profane what is holy; |
|
they do violence to the law. |
|
The Lord within her is righteous; |
|
he does no injustice; |
|
every morning he shows forth his justice; |
|
each dawn he does not fail; |
|
but the unjust knows no shame. |
|
|
|
“I have cut off nations; |
|
their battlements are in ruins; |
|
I have laid waste their streets |
|
so that no one walks in them; |
|
their cities have been made desolate, |
|
without a man, without an inhabitant. |
|
I said, ‘Surely you will fear me; |
|
you will accept correction. |
|
Then your dwelling would not be cut off |
|
according to all that I have appointed against you.’ |
|
But all the more they were eager |
|
to make all their deeds corrupt. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk8.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 9 - Zeph 3:8-10, Part 1", |
|
Description = @"Week 9 - Zeph 3:8-10, Part 1 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-9-Zeph-3v8-10-Part-1.pptx |
|
|
|
Zephaniah 3:8-10 |
|
“Therefore wait for me,” declares the Lord, |
|
“for the day when I rise up to seize the prey. |
|
For my decision is to gather nations, |
|
to assemble kingdoms, |
|
to pour out upon them my indignation, |
|
all my burning anger; |
|
for in the fire of my jealousy |
|
all the earth shall be consumed. |
|
|
|
“For at that time I will change the speech of the peoples |
|
to a pure speech, |
|
that all of them may call upon the name of the Lord |
|
and serve him with one accord. |
|
From beyond the rivers of Cush |
|
my worshipers, the daughter of my dispersed ones, |
|
shall bring my offering. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk9.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 10 - Zeph 3:8-10, Part 2", |
|
Description = @"Week 10 - Zeph 3:8-10, Part 2 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-10-Zeph-3v8-10-Part-2.pptx |
|
|
|
Zephaniah 3:8-10 |
|
“Therefore wait for me,” declares the Lord, |
|
“for the day when I rise up to seize the prey. |
|
For my decision is to gather nations, |
|
to assemble kingdoms, |
|
to pour out upon them my indignation, |
|
all my burning anger; |
|
for in the fire of my jealousy |
|
all the earth shall be consumed. |
|
|
|
“For at that time I will change the speech of the peoples |
|
to a pure speech, |
|
that all of them may call upon the name of the Lord |
|
and serve him with one accord. |
|
From beyond the rivers of Cush |
|
my worshipers, the daughter of my dispersed ones, |
|
shall bring my offering. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk10.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 11 - Zeph 3:11-13", |
|
Description = @"Week 11 - Zeph 3:11-13 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-11-Zeph-3v11-13.pptx |
|
|
|
Zephaniah 3:11-13 |
|
“On that day you shall not be put to shame |
|
because of the deeds by which you have rebelled against me; |
|
for then I will remove from your midst |
|
your proudly exultant ones, |
|
and you shall no longer be haughty |
|
in my holy mountain. |
|
But I will leave in your midst |
|
a people humble and lowly. |
|
They shall seek refuge in the name of the Lord, |
|
those who are left in Israel; |
|
they shall do no injustice |
|
and speak no lies, |
|
nor shall there be found in their mouth |
|
a deceitful tongue. |
|
For they shall graze and lie down, |
|
and none shall make them afraid.” |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk11.mp3" |
|
}); |
|
|
|
// No Audio Available |
|
// |
|
// p.Episodes.Add(new Episode |
|
// { |
|
// Title = "Week 12 - Zeph 3:14-15", |
|
// Description = @"Week 12 - Zeph 3:14-15 |
|
// |
|
//Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-12-Zeph-3v14-15.pptx |
|
// |
|
//Zephaniah 3:14-15 |
|
//Sing aloud, O daughter of Zion; |
|
// shout, O Israel! |
|
//Rejoice and exult with all your heart, |
|
// O daughter of Jerusalem! |
|
//The Lord has taken away the judgments against you; |
|
// he has cleared away your enemies. |
|
//The King of Israel, the Lord, is in your midst; |
|
// you shall never again fear evil. |
|
//", |
|
// Mp3Url = null |
|
// }); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 13 - Zeph 3:16-20, Part 1", |
|
Description = @"Week 13 - Zeph 3:16-20, Part 1 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-13-Zeph-3v16%E2%80%9320-Pt-1.pptx |
|
|
|
Zephaniah 3:16-20 |
|
On that day it shall be said to Jerusalem: |
|
“Fear not, O Zion; |
|
let not your hands grow weak. |
|
The Lord your God is in your midst, |
|
a mighty one who will save; |
|
he will rejoice over you with gladness; |
|
he will quiet you by his love; |
|
he will exult over you with loud singing. |
|
I will gather those of you who mourn for the festival, |
|
so that you will no longer suffer reproach. |
|
Behold, at that time I will deal |
|
with all your oppressors. |
|
And I will save the lame |
|
and gather the outcast, |
|
and I will change their shame into praise |
|
and renown in all the earth. |
|
At that time I will bring you in, |
|
at the time when I gather you together; |
|
for I will make you renowned and praised |
|
among all the peoples of the earth, |
|
when I restore your fortunes |
|
before your eyes,” says the Lord. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk13.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 14 - Zeph 3:16-20, Part 2", |
|
Description = @"Week 14 - Zeph 3:16-20, Part 2 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-14-Zeph-3v16%E2%80%9320-Pt-2.pptx |
|
|
|
Zephaniah 3:16-20 |
|
On that day it shall be said to Jerusalem: |
|
“Fear not, O Zion; |
|
let not your hands grow weak. |
|
The Lord your God is in your midst, |
|
a mighty one who will save; |
|
he will rejoice over you with gladness; |
|
he will quiet you by his love; |
|
he will exult over you with loud singing. |
|
I will gather those of you who mourn for the festival, |
|
so that you will no longer suffer reproach. |
|
Behold, at that time I will deal |
|
with all your oppressors. |
|
And I will save the lame |
|
and gather the outcast, |
|
and I will change their shame into praise |
|
and renown in all the earth. |
|
At that time I will bring you in, |
|
at the time when I gather you together; |
|
for I will make you renowned and praised |
|
among all the peoples of the earth, |
|
when I restore your fortunes |
|
before your eyes,” says the Lord. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk14.mp3" |
|
}); |
|
|
|
p.Episodes.Add(new Episode |
|
{ |
|
Title = "Week 15 - Zeph 3:16-20, Part 3", |
|
Description = @"Week 15 - Zeph 3:16-20, Part 3 |
|
|
|
Slides: https://jasonderouchie.com/wp-content/uploads/2015/12/Week-15-Zeph-3v16%E2%80%9320-Pt-3-Conclusion.pptx |
|
|
|
Zephaniah 3:16-20 |
|
On that day it shall be said to Jerusalem: |
|
“Fear not, O Zion; |
|
let not your hands grow weak. |
|
The Lord your God is in your midst, |
|
a mighty one who will save; |
|
he will rejoice over you with gladness; |
|
he will quiet you by his love; |
|
he will exult over you with loud singing. |
|
I will gather those of you who mourn for the festival, |
|
so that you will no longer suffer reproach. |
|
Behold, at that time I will deal |
|
with all your oppressors. |
|
And I will save the lame |
|
and gather the outcast, |
|
and I will change their shame into praise |
|
and renown in all the earth. |
|
At that time I will bring you in, |
|
at the time when I gather you together; |
|
for I will make you renowned and praised |
|
among all the peoples of the earth, |
|
when I restore your fortunes |
|
before your eyes,” says the Lord. |
|
", |
|
Mp3Url = "https://jasonderouchie.com/wp-content/uploads/2015/12/Zephaniah-Wk15.mp3" |
|
}); |
|
|
|
var lastDate = new DateTime(2015, 12, 3).AddDays(7); |
|
foreach (var ep in p.Episodes) |
|
{ |
|
if (ep.Mp3Url != null && ep.Mp3Length <= 0) |
|
{ |
|
ep.Mp3Length = await GetResponseLengthAsync(ep.Mp3Url); |
|
} |
|
ep.PublishDate = lastDate = lastDate.AddDays(-7); |
|
} |
|
|
|
p.ToFeedXml().Dump(); |
|
} |
|
|
|
class Podcast |
|
{ |
|
public string Title { get; set; } |
|
public string Description { get; set; } |
|
public string FeedUrl { get; set; } |
|
public string LinkUrl { get; set; } |
|
public List<Episode> Episodes { get; } = new List<Episode>(); |
|
|
|
public XDocument ToFeedXml() |
|
{ |
|
XNamespace contentNS = "http://purl.org/rss/1.0/modules/content/"; |
|
XNamespace atomNS = "http://www.w3.org/2005/Atom"; |
|
|
|
var channel = new XElement("channel", |
|
new XElement("title", new XText(Title)), |
|
new XElement("description", new XText(Description)), |
|
new XElement("language", new XText("en")), |
|
new XElement("link", new XText(LinkUrl)), |
|
new XElement(atomNS + "link", |
|
new XAttribute("href", LinkUrl), |
|
new XAttribute("rel", "self"), |
|
new XAttribute("type", "application/rss+xml"))); |
|
|
|
foreach (var item in Episodes) |
|
{ |
|
channel.Add(new XElement("item", |
|
new XElement("title", new XText(item.Title ?? string.Empty)), |
|
new XElement("description", new XText(item.Description ?? string.Empty)), |
|
new XElement("guid", new XText(item.Guid ?? item.Mp3Url ?? Guid.NewGuid().ToString())), |
|
new XElement("link", new XText(item.LinkUrl ?? LinkUrl)), |
|
new XElement("enclosure", |
|
new XAttribute("url", item.Mp3Url ?? string.Empty), |
|
new XAttribute("type", "audio/mpeg"), |
|
new XAttribute("length", item.Mp3Length)), |
|
new XElement("pubDate", new XText(GetRfc822String(item.PublishDate))))); |
|
} |
|
|
|
var xdoc = new XDocument( |
|
new XElement("rss", |
|
new XAttribute("version", "2.0"), |
|
new XAttribute(XNamespace.Xmlns + "content", "http://purl.org/rss/1.0/modules/content/"), |
|
new XAttribute(XNamespace.Xmlns + "atom", "http://www.w3.org/2005/Atom"), |
|
channel)); |
|
return xdoc; |
|
} |
|
} |
|
|
|
class Episode |
|
{ |
|
public string Guid { get; set; } |
|
public string Mp3Url { get; set; } |
|
public long Mp3Length { get; set; } |
|
public string LinkUrl { get; set; } |
|
public string Title { get; set; } |
|
public string Description { get; set; } |
|
public DateTime PublishDate { get; set; } |
|
} |
|
|
|
static async Task<long> GetResponseLengthAsync(string url) |
|
{ |
|
var r = System.Net.WebRequest.CreateHttp(url); |
|
r.Method = "HEAD"; |
|
try |
|
{ |
|
using (var res = await r.GetResponseAsync()) |
|
{ |
|
return res.ContentLength; |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
ex.ToString().Dump($"Error getting length of {url}"); |
|
return 0; |
|
} |
|
} |
|
|
|
static string GetRfc822String(DateTime timestamp) => GetRfc822String(new DateTimeOffset(timestamp)); |
|
|
|
static string GetRfc822String(DateTimeOffset timestamp) |
|
{ |
|
if (timestamp.Offset == TimeSpan.Zero) |
|
{ |
|
return timestamp.ToString("ddd, dd MMM yyyy HH':'mm':'ss 'GMT'"); |
|
} |
|
else |
|
{ |
|
return timestamp.ToString("ddd, dd MMM yyyy HH':'mm':'ss ") + timestamp.ToString("zzz").Replace(":", ""); |
|
} |
|
} |