File indexing completed on 2024-12-08 05:16:44

0001 #!/usr/bin/env python3
0002 
0003 # SPDX-FileCopyrightText: 2023 Plata Hill <plata.hill@kdemail.net>
0004 # SPDX-License-Identifier: LGPL-2.1-or-later
0005 
0006 begin = """<!--
0007   - SPDX-License-Identifier: CC0-1.0
0008   - SPDX-FileCopyrightText: 2023 Plata Hill <plata.hill@kdemail.net>
0009  -->
0010 <!DOCTYPE html>
0011 <html xmlns="http://www.w3.org/1999/xhtml" lang="de-DE">
0012 <body>
0013 <table class="info-table">"""
0014 
0015 rowTemplate = """
0016     <tr class="hover">
0017         <td class="programm-col1">
0018             <a href="https://www.tvspielfilm.de/tv-programm/sendungen/swrsr,SWR.html" title="SWR/SR Programm">
0019                     <span class="logotype">
0020                         <picture>
0021                             <source srcset="https://a2.tvspielfilm.de/images/tv/sender/mini/swr.webp" type="image/webp">
0022                             <source srcset="https://a2.tvspielfilm.de/images/tv/sender/mini/swr.png" type="image/png">
0023                             <img src="https://a2.tvspielfilm.de/images/tv/sender/mini/swr.png" alt="SWR/SR Programm"
0024                                  title="SWR/SR Programm" loading="eager" width="40" height="40">
0025                         </picture>
0026                      </span>
0027             </a></td>
0028         <td class="col-2">
0029             <div>
0030                 <strong>{startTime} - {endTime}</strong>
0031                 <span>Mi 28.12.</span>
0032             </div>
0033         </td>
0034         <td class="col-3">
0035             <span>
0036                 <a href="https://www.tvspielfilm.de/tv-programm/sendung/description.html"
0037                    title="Title">
0038                     <strong>Title</strong>
0039                 </a>
0040             </span>
0041             <div id="progressbar_1" class="progressbar" style="display:none;">
0042                 <div id="progressbar_1"></div>
0043                 <span id="pinfo_1" class="progressbar-info" data-rel-start="{startTimeEpoch}" data-rel-end="{endTimeEpoch}"></span>
0044             </div>
0045         </td>
0046         <td class="col-4">
0047             <span>Category</span>
0048         </td>
0049         <td class="col-5">
0050             <span></span>
0051         </td>
0052         <td class="col-6"><span class="editorial-rating small"></span></td>
0053     </tr>"""
0054 
0055 end = """
0056 </table>
0057 </body>
0058 </html>
0059 """
0060 
0061 with open('swr.html', 'w') as f:
0062     f.write(begin)
0063 
0064     num_minutes = 60 * 24 - 1
0065     for minute in range(num_minutes):
0066         f.write(rowTemplate.format(
0067             startTime = "{:02d}:{:02d}".format(int(minute / 60), minute % 60),
0068             endTime = "{:02d}:{:02d}".format(int((minute + 1) / 60), (minute + 1) % 60),
0069             startTimeEpoch = 1672182000 + minute * 60,
0070             endTimeEpoch = 1672182000 + (minute + 1) * 60
0071         ))
0072     f.write(end)