tv2feed.html (2834B) - raw


      1 <!-- title: TV2Feed -->
      2 <!-- description: TV2Feed: Follow TV shows using Atom feeds! -->
      3 
      4 <p>Follow TV shows using Atom feeds!</p>
      5 
      6 <p>
      7   TV2Feed is a Python script that creates Atom feeds for TV shows, creating one entry per episode.
      8   The script can be found <a href="https://git.oscarbenedito.com/osf/file/tv2feed.py.html">here</a>.
      9   For examples of outputs (which are not updated periodically), see <a
     10   href="/projects/tv2feed/feed">feed</a> (combined shows feed) or <a
     11   href="/projects/tv2feed/show/210">show/210</a> (single show feed).</p>
     12 <!-- /p -->
     13 
     14 <h2>How to use</h2>
     15 
     16 <p>
     17   Download the script and edit the global variables to your liking. Go to <a
     18   href="https://www.tvmaze.com">https://www.tvmaze.com</a> and search the TV shows you want to
     19   follow. Write down their IDs (the number in the URL) and then run the following:</p>
     20 <!-- /p -->
     21 
     22 <pre><code>tv2feed id1 id2 ...</code></pre>
     23 
     24 <p>Or run it multiple times to get one feed per TV show. The feeds are expected to go under:</p>
     25 
     26 <ul>
     27   <li><code>https://&lt;domain&gt;/&lt;path&gt;/feed</code>: if multiple shows specified</li>
     28   <li><code>https://&lt;domain&gt;/&lt;path&gt;/show/&lt;show_id&gt;</code>: if only one show specified</li>
     29 </ul>
     30 
     31 <p>
     32   Were <code>&lt;domain&gt;</code> and <code>&lt;path&gt;</code> are the values specified on the
     33   script variables. That is because the feed URIs will point there. Note that if only one show is
     34   specified, TV2Feed will generate it assuming there is one feed per show (which will make the feed
     35   title the same as the show's).</p>
     36 <!-- /p -->
     37 
     38 <p>The API where the data is gathered from caches results for one hour, so you can add cron jobs to run every hour:</p>
     39 
     40 <pre><code>0 * * * * /usr/local/bin/tv2feed 210 431 &gt; /srv/www/tv2feed/feed</code></pre>
     41 
     42 <p>or, alternatively (could also be scripted with just one cronjob):</p>
     43 
     44 <pre><code>0 * * * * /usr/local/bin/tv2feed 210 &gt; /srv/www/tv2feed/show/210
     45 <!--    -->0 * * * * /usr/local/bin/tv2feed 431 &gt; /srv/www/tv2feed/show/431</code></pre>
     46 
     47 <h2>Contact</h2>
     48 
     49 <p>If you have any questions or there is an edge case I did not account for, please <a href="/contact/">let me know</a>.</p>
     50 
     51 <h2>Other notes</h2>
     52 
     53 <p>
     54   Each show will make two API requests, and there is a limit of 20 requests every 10 seconds (for
     55   contents that are not cached). If you are following many shows, this script will sleep for 10
     56   seconds and try again if an API call returns a 429 error code, if it fails again (or the error
     57   code is not 429), it will raise an error and exit.</p>
     58 <!-- /p -->
     59 
     60 <p>
     61   TV2Feed is licensed under the GNU Affero General Public License version 3 or later (available <a
     62   href="https://www.gnu.org/licenses/agpl-3.0.html">here</a>).</p>
     63 <!-- /p -->
     64 
     65 <p>All data generated is gathered from <a href="https://www.tvmaze.com">TVmaze</a>'s API.</p>