RSS feed XML added

main
Rob Canning 2024-01-15 12:10:58 +01:00
parent 9f70858aca
commit a3c08e7873
6 changed files with 214 additions and 154 deletions

Binary file not shown.

View File

@ -42,14 +42,12 @@
<div class="row align-items-center">
<div class="col-3" data-aos="fade-down">
<h1><a href="index.html" class="text-white h2">{{show_name}}</a></h1>
</div>
<!-- <div class="col-3" data-aos="fade-down"> -->
<!-- <h1><a href="index.html" class="text-white h2">{{show_name}}</a></h1> -->
<!-- </div> -->
<div class="col-9" data-aos="fade-down">
<nav class="site-navigation position-relative text-right text-md-right" role="navigation">
<div class="d-inline-block ml-md-0 mr-auto py-3"><a href="#" class="site-menu-toggle js-menu-toggle text-white"><span class="icon-menu h3"></span></a></div>
<ul class="site-menu js-clone-nav d-none">
@ -111,75 +109,17 @@
<div class="row justify-content-center">
<div class="col-md-7">
{{episode_playlist}}
<h4>This weeks playlist:</h4>
{% for track in episode_playlist[1:] %}
<item>
<p>{{track}}</p>
</item>
{% endfor %}
</div>
</div>
{% for result in show_info %}
<tr>
<td>{{ result[0] }}</td>
<td>{{ result[1] }}</td>
<td>{{ result[2] }}</td>
</tr>
{% endfor %}
</div>
<div class="site-section bg-light">
<div class="container">
<div class="row mb-5">
<div class="col-md-12 text-center">
<h2 class="font-weight-bold text-black">Related Podcasts</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="d-block podcast-entry bg-white mb-5" data-aos="fade-up">
<div class="image w-100" style="height: 300px; background-image: url('images/img_2.jpg');"></div>
<div class="text w-100">
<h3 class="font-weight-light"><a href="single-post.html">Episode 07: How To Create Web Page Using Bootstrap 4</a></h3>
<div class="text-white mb-3"><span class="text-black-opacity-05"><small>By Mike Smith <span class="sep">/</span> 16 September 2017 <span class="sep">/</span> 1:30:20</small></span></div>
<p class="mb-4">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti repellat mollitia consequatur, optio nesciunt placeat. Iste voluptates excepturi tenetur, nesciunt.</p>
<div class="player">
<audio id="player2" preload="none" controls style="max-width: 100%">
<source src="http://www.largesound.com/ashborytour/sound/AshboryBYU.mp3" type="audio/mp3">
</audio>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="d-block podcast-entry bg-white mb-5" data-aos="fade-up">
<div class="image w-100" style="height: 300px; background-image: url('images/img_3.jpg');"></div>
<div class="text w-100">
<h3 class="font-weight-light"><a href="single-post.html">Episode 07: How To Create Web Page Using Bootstrap 4</a></h3>
<div class="text-white mb-3"><span class="text-black-opacity-05"><small>By Mike Smith <span class="sep">/</span> 16 September 2017 <span class="sep">/</span> 1:30:20</small></span></div>
<p class="mb-4">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corrupti repellat mollitia consequatur, optio nesciunt placeat. Iste voluptates excepturi tenetur, nesciunt.</p>
<div class="player">
<audio id="player2" preload="none" controls style="max-width: 100%">
<source src="http://www.largesound.com/ashborytour/sound/AshboryBYU.mp3" type="audio/mp3">
</audio>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="site-footer border-top">
@ -187,8 +127,8 @@
<div class="row">
<div class="col-lg-4">
<div class="mb-5">
<h3 class="footer-heading mb-4">{{about_show}}</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe pariatur reprehenderit vero atque, consequatur id ratione, et non dignissimos culpa? Ut veritatis, quos illum totam quis blanditiis, minima minus odio!</p>
<h3 class="footer-heading mb-4">About {{show_name}}</h3>
<p>{{about_show}}</p>
</div>
@ -233,21 +173,10 @@
</div>
<div class="col-lg-4 mb-5 mb-lg-0">
<div class="mb-5">
<h3 class="footer-heading mb-4">Watch Video</h3>
<div class="block-16">
<figure>
<img src="images/img_1.jpg" alt="Image placeholder" class="img-fluid rounded">
<a href="https://vimeo.com/channels/staffpicks/93951774" class="play-button popup-vimeo"><span class="icon-play"></span></a>
</figure>
</div>
</div>
<div class="mb-5">
<h3 class="footer-heading mb-2">Subscribe Newsletter</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit minima minus odio.</p>
<p>Contact us at: info@zavodrizoma.si.</p>
<form action="#" method="post">
<div class="input-group mb-3">

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>show_name</title>
<title>{{show_name}}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
@ -42,12 +42,11 @@
<div class="row align-items-center">
<div class="col-3" data-aos="fade-down">
<h1><a href="#" class="text-white h2">{{show_name}}</a></h1>
</div>
<!-- <div class="col-3" data-aos="fade-down"> -->
<!-- <h1><a href="#" class="text-white h2">{{show_name}}</a></h1> -->
<!-- </div> -->
<div class="col-9" data-aos="fade-down">
<nav class="site-navigation position-relative text-right text-md-right" role="navigation">
<div class="d-inline-block ml-md-0 mr-auto py-3"><a href="#" class="site-menu-toggle js-menu-toggle text-white"><span class="icon-menu h3"></span></a></div>
@ -276,8 +275,8 @@
<div class="row">
<div class="col-lg-4">
<div class="mb-5">
<h3 class="footer-heading mb-4">About SHOWNAME</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe pariatur reprehenderit vero atque, consequatur id ratione, et non dignissimos culpa? Ut veritatis, quos illum totam quis blanditiis, minima minus odio!</p>
<h3 class="footer-heading mb-4">About {{show_name}}</h3>
<p>{{about_show}}</p>
</div>
<div class="mb-5">

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>{{show_name}} RSS</title>
<link>http://{{show_name}}.rizoma.si</link>
<description>{{show_name}} Music Podcast</description>
{% for rss_item in range(episode_number) %}
<item>
<title>Episode # {{episode_number}} - The Slo Indie Show</title>
<link>http://{{showname}}.rizoma.si/episode/{{episode_number}}/show.mp3</link>
<description>Episode # {{episode_number}} of The Slovenian Indie Show</description>
</item>
{% endfor %}
</channel>
</rss>

View File

@ -9,34 +9,11 @@ import sqlite3, json
from mk_web import *
conn = sqlite3.connect("database/music.db")
#cursor = conn.cursor()
#cursor.execute("DROP TABLE SHOW")
#conn.commit()
conn.execute('''CREATE TABLE IF NOT EXISTS SHOW(
ID INTEGER PRIMARY KEY AUTOINCREMENT,
EPISODE INT NOT NULL,
DATE TEXT NOT NULL,
DURATION INT NOT NULL,
ALBUM TEXT NOT NULL,
TRACK TEXT NOT NULL,
ARTIST TEXT NOT NULL,
TRACKDUR INT NOT NULL,
YEAR TEXT NOT NULL
);''')
print("Table created successfully");
#conn.execute("INSERT INTO SHOW (ID, EPISODE,DATE,TRACK,ARTIST) \
#VALUES (1, 1, 'wednesday', 'Some song', 'Some Artist' )");
#conn.commit()
#print("DB Record created successfully");
#conn.close()
show_short_description = "An eclectic selection of independent and experimental music from Slovenia. Published weekly by The Rizoma Institute. Hosted and compiled by Rob Canning. Broadcast in Slovenia on FM by Mariborski radio student - MARŠ"
episode_number = sys.argv[1]
input_date = sys.argv[2]
episode_date = datetime.datetime.now().strftime("%Y-%m-%d")
episode_duration = 0
complete_playlist = []
@ -45,8 +22,8 @@ show_cover = ""
archive = []
artists_played = []
artist_abreviated = []
episode_number = sys.argv[1]
show_name = "SHOWNAME" # OBED
show_name = "The_SLO_Indie" # OBED
path = "/home/rob/antena/"
web_path = "/home/rob/antena/html/episode/{0}/img".format(episode_number)
@ -55,6 +32,45 @@ if os.path.exists(web_path):
else: os.makedirs(web_path)
# /////////////////////////////////////////////////
def set_episode_date(input_date):
date_str = '2023-02-28 '
date_format = '%Y-%m-%d %H:%M:%S'
episode_date = datetime.strptime(date_str, date_format)
return episode_date
print(episode_date)
conn = ''
def database_create():
# the show database
global conn
conn = sqlite3.connect("database/show.db")
#cursor = conn.cursor()
#cursor.execute("DROP TABLE SHOW")
#conn.commit()
conn.execute('''CREATE TABLE IF NOT EXISTS SHOW(
ID INTEGER PRIMARY KEY AUTOINCREMENT,
EPISODE INT NOT NULL,
DATE TEXT NOT NULL,
DURATION INT NOT NULL,
ALBUM TEXT NOT NULL,
TRACK TEXT NOT NULL,
ARTIST TEXT NOT NULL,
TRACKDUR INT NOT NULL,
YEAR TEXT NOT NULL
);''')
print("Table created successfully");
#conn.execute("INSERT INTO SHOW (ID, EPISODE,DATE,TRACK,ARTIST) \
#VALUES (1, 1, 'wednesday', 'Some song', 'Some Artist' )");
#conn.commit()
#print("DB Record created successfully");
#conn.close()
def create_intro(show_array):
intropath = path + "texts/clips/this_is"
@ -280,14 +296,13 @@ def create_podcast(show_array: list):
print('''
------------------------
creating show audio
------------------------
''')
------------------------''')
from glob import glob
from pydub import AudioSegment
playlist_songs = [AudioSegment.from_file(flac_file) for flac_file in show_array]
print(playlist_songs)
show_intro = playlist_songs[0]
# first_song = playlist_songs[0].fade_in(0) # only fadein if used over show intro - currently not used
# intro_and_first = first_song.overlay(show_intro)
@ -298,38 +313,41 @@ def create_podcast(show_array: list):
# next two commented lines are for if intro goes over first track or not
#playlist = intro_and_first
playlist = show_intro
# playlist = []
#for song in playlist_songs[2:3]:
for song in playlist_songs[1:4]: # first three songs (first added with intro)
# We don't want an abrupt stop at the end, so let's do a 1 second crossfades
playlist = playlist.append(song, crossfade=(1 * 1000))
playlist = playlist.append(song)
print(song)
print("first songs added")
# blurb about first three tracks
playlist = playlist.append(first_three_blurb) # <--------------BLURB INSERT
# playlist = playlist.append(first_three_blurb) # <--------------BLURB INSERT
for song in playlist_songs[4:7]: # second three songs
playlist = playlist.append(song, crossfade=(1 * 1000))
playlist = playlist.append(song)
print(song)
print("second songs added")
playlist = playlist.append(second_three_blurb) # <--------------BLURB INSERT
# playlist = playlist.append(second_three_blurb) # <--------------BLURB INSERT
for song in playlist_songs[7:10]: # second three song
playlist = playlist.append(song, crossfade=(1 * 1000))
#playlist = playlist.append(song, crossfade=(1 * 1000))
playlist = playlist.append(song)
print(song)
print("third songs added")
playlist = playlist.append(final_songs_blurb) # <--------------BLURB INSERT
# playlist = playlist.append(final_songs_blurb) # <--------------BLURB INSERT
for song in playlist_songs[10:13]: # second three song
playlist = playlist.append(song, crossfade=(1 * 1000))
playlist = playlist.append(song)
print(song)
print("final songs added")
playlist = playlist.append(final_show_outro) # <-------------- OUTRO SEQUENCE
# playlist = playlist.append(final_show_outro) # <-------------- OUTRO SEQUENCE
# get length of final show / podcast
playlist_length = len(playlist) / (1000*60)
@ -365,7 +383,8 @@ def create_html_episode_from_template():
show_info.append("" + detail)
output_from_parsed_template = episode_template.render(episode_author="rrrrrrrr",\
episode_duration=episode_duration, episode_date=episode_date, about_show="bla bla", episode_playlist=show_info, \
episode_duration=episode_duration, episode_date=episode_date, \
about_show=show_short_description, episode_playlist=show_info, \
episode_image="img/cover.png".format(episode_number))
with open("html/episode/{0}/index.html".format(episode_number), "w") as episode_page:
@ -389,7 +408,7 @@ def create_html_episode_from_template():
show_info.append("" + detail)
output_from_parsed_template = episode_template.render(episode_author="rrrrrrrr",\
episode_duration="123", about_show="bla bla", episode_playlist=show_info, \
episode_duration="123", about_show=show_short_description, episode_playlist=show_info, \
episode_image="img/cover.png".format(episode_number))
with open("html/episode/{0}/index.html".format(episode_number), "w") as episode_page:
@ -408,7 +427,7 @@ def create_html_homepage_from_template():
episode_artists = []
for i in range(10):
artists = []
conn = sqlite3.connect("database/music.db")
conn = sqlite3.connect("database/show.db")
cur = conn.cursor()
cur.execute("SELECT ARTIST FROM SHOW WHERE EPISODE=?", [i])
rows = cur.fetchall()
@ -420,12 +439,13 @@ def create_html_homepage_from_template():
artists.append(artist)
episode_artists.append(artists)
episodes = []
for i in range(10):
for i in range(10):
print(episode_artists)
an_episode = dict(date="2012-02-", episode_artists=episode_artists[i], episode_number=i, episode_date=episode_date, episode_duration=episode_duration)
an_episode = dict(date="2012-02-", \
episode_artists=episode_artists[i], episode_number=i, \
episode_date=episode_date, \
episode_duration=episode_duration)
episodes.append(an_episode)
episodes = reversed(episodes) # reversed order to most recent episode appears first in list
@ -438,15 +458,60 @@ def create_html_homepage_from_template():
" | " + str(timedelta(seconds=round(track.duration)))
show_info.append("" + detail)
output_from_parsed_template = homepage_template.render(episodes=episodes, episode_author="Rob Canning",\
episode_duration="123", episode_number=episode_number, episode_artists=episode_artists, \
about_show="bla bla", episode_playlist=show_info, \
episode_image="episode/{0}/img/cover.png".format(episode_number))
output_from_parsed_template = homepage_template.render(\
show_name=''.join(random.choice((str.upper,str.lower))(x) for x in show_name), \
episodes=episodes, episode_author="Rob Canning",\
episode_duration=episode_duration, episode_number=episode_number, \
episode_artists=episode_artists, \
about_show=show_short_description, episode_playlist=show_info, \
episode_image="episode/{0}/img/cover.png".format(episode_number))
with open("html/index.html".format(episode_number), "w") as episode_page:
episode_page.write(output_from_parsed_template)
def create_html_episode_from_template():
from jinja2 import Template, Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('html/templates'))
episode_template = env.get_template('episode.jinja')
show_info = []
# maybe a jinja2 template loop here instead
for i in show_array:
track = TinyTag.get(i)
detail = str(track.artist) + " | " + str(track.album) + \
" | " + str(track.title) + " | " + str(track.year) + \
" | " + str(timedelta(seconds=round(track.duration)))
show_info.append("" + detail)
output_from_parsed_template = episode_template.render(\
show_name=show_name, episode_author="Rob Canning",\
episode_duration=episode_duration, \
episode_date=episode_date, about_show=show_short_description, \
episode_playlist=show_info, \
episode_image="img/cover.png".format(episode_number))
with open("html/episode/{0}/index.html".format(episode_number), "w") as episode_page:
episode_page.write(output_from_parsed_template)
def create_RSS_XML_from_template():
from jinja2 import Template, Environment, FileSystemLoader
env = Environment(loader=FileSystemLoader('html/templates'))
rss_template = env.get_template('show_RSS_xml.jinja')
output_from_parsed_template = rss_template.render(\
show_name=show_name, \
episode_number=int(episode_number), episode_author="Rob Canning",\
episode_duration=episode_duration, about_show=show_short_description, \
episode_image="img/cover.png".format(episode_number))
with open("html/show_rss.xml".format(episode_number), "w") as rss_page:
rss_page.write(output_from_parsed_template)
database_create()
create_show_playlist(show_array, complete_playlist)
create_show_coverart(show_array, 1) #episode_duration = 100
#create_animated_gif()
@ -457,6 +522,8 @@ create_pls_file()
create_html_episode_from_template()
create_html_homepage_from_template()
create_RSS_XML_from_template()
create_podcast(show_array)

View File

@ -1,12 +1,57 @@
don't tell me what i like
Nothing Concealed
Action XV
Leather Wings
Loss of Consciousness
Strenuous Effort
Irena Z. Tomažin - Cmok v grlu - Lump In The Throat - 14 Klic meduze
Hunahpu & Xbalanque
Chorus 1 (SC)
Elephant in The Mush Rooms
Transition (Excerpt)
Her Boat
Todestriebe
Extra space
Tone Pavček & Tomaž Grom - Sonce in sončice po vsem svetu - 04 Čenčačeva uspavanka
Tomaž Grom & Seijiro Murayama - Nepretrganost - 04 Štiri.
Slika 6
1 9 5 Ints (Edit)
Crisp Ursa Minor
Laszlo
Inchoate Crimes
Action I
Jean-Luc Guionnet & Samo Kutin - Kopaš - 05 05
Stabit
Sub Persona IX
decrepitation_var.1a-2
Speshlafer
PSH
won't work for free anymore
Apropos
Weakest Parts of Society
death rattle_var.2-4
Tomaž Grom & Seijiro Murayama - Nepretrganost - 04 Štiri.
Small Tyrant
Scena Prologue
Pagan (KK Null remix)
Samo Kutin - Plovilo - 02 Bliže
voices
Jean-Luc Guionnet & Samo Kutin - Kopaš - 07 07
Sub Persona IX
Crisp Ursa Minor
Zlatko Kaučič, Tomaž Grom - The Ear Is The Shadow Of The Eye - 01 From Hands To Ears - Iz rok v ušesa
Whale Ft Outtake
Mono Scarves - Kaj pa tisti rizling
Parallax Division
Asphalt
Loveful
Vertex
Je Šel Brat S Sestro
a3
Jošt Drašler - The Balloon Catcher - 06 Green Balloon
Trojnik (Cene Resnik, Tomaž Grom, Vid Drašler) - Moje uho ima ostre robove - 03 03
BE CREEP - LIVE
RIP Girls Toys
Zlatko Kaučič, Tomaž Grom - Torn Memories Of Folklore - Raztrgana folklora spomina - 03 Scattered Out Of Context
Matej Bonin - Gymnastics of non-sense II - 02 Part II
Trojnik (Cene Resnik, Tomaž Grom, Vid Drašler) - Moje uho ima ostre robove - 11 11
Samo Kutin - Plovilo - 02 Bliže
Descent
Antichrist
Vid Drašler - Kramljanja - 07 7.
Ultrascan
stepbystep
Oscillopsia
Soft Orange
Offset V2