Commits

Anonymous committed 338beeb

r5664@telaviv1: shlomi | 2008-06-12 18:13:29 +0300
Added the films' recommendations.

  • Participants
  • Parent commits 6f56aa3

Comments (0)

Files changed (5)

 
 #### Humour thing
 
-T2_HUMOUR_DOCS_SRC = $(filter $(T2_SRC_DIR)/humour/%,$(T2_DOCS_SRC)) \
+T2_HUMOUR_DOCS_SRC = $(filter-out $(T2_SRC_DIR)/humour/recommendations/%,$(filter $(T2_SRC_DIR)/humour/%,$(T2_DOCS_SRC))) \
 					 $(filter $(T2_SRC_DIR)/humour.html.wml,$(T2_DOCS_SRC)) \
 					 $(filter $(T2_SRC_DIR)/wysiwyt.html.wml,$(T2_DOCS_SRC)) \
 					 $(filter $(T2_SRC_DIR)/wonderous.html.wml,$(T2_DOCS_SRC))
 PROD_SYND_NON_FICTION_BOOKS_DIR = lib/prod-synd/non-fiction-books
 PROD_SYND_NON_FICTION_BOOKS_INC = $(PROD_SYND_NON_FICTION_BOOKS_DIR)/include-me.html
 
+PROD_SYND_FILMS_DIR = lib/prod-synd/films
+PROD_SYND_FILMS_INC = $(PROD_SYND_FILMS_DIR)/include-me.html
+
 $(T2_SRC_DIR)/art/recommendations/music/index.html.wml : $(PROD_SYND_MUSIC_INC)
 	touch $@
 
 	./gen-helpers.pl
 	$(MAKE)
 
+$(T2_SRC_DIR)/humour/recommendations/films/index.html.wml: $(PROD_SYND_FILMS_INC)
+	touch $@
+
+$(PROD_SYND_FILMS_INC) : $(PROD_SYND_FILMS_DIR)/gen-prod-synd.pl $(T2_SRC_DIR)/humour/recommendations/films/shlomi-fish-films-recommendations.xml
+	perl $<
+	./gen-helpers.pl
+	$(MAKE)
+
+
 $(SITE_SOURCE_INSTALL_TARGET): INSTALL
 	cp -f $< $@
 

lib/prod-synd/films/gen-prod-synd.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use XML::Grammar::ProductsSyndication;
+
+use XML::LibXML::XPathContext;
+
+my $wml_dir = "t2/humour/recommendations/films";
+my $lib_dir = "lib/prod-synd/films";
+my $ps = XML::Grammar::ProductsSyndication->new(
+    {
+        'source' =>
+        {
+            'file' => "$wml_dir/shlomi-fish-films-recommendations.xml",
+        }
+    },
+);
+
+if (!$ps->is_valid())
+{
+    die "Not valid.";
+}
+my $xml = $ps->transform_into_html({ 'output' => "xml" });
+
+my $xc = XML::LibXML::XPathContext->new($xml);
+$xc->registerNs('html' => "http://www.w3.org/1999/xhtml");
+
+open my $out, ">", "$lib_dir/include-me.html";
+binmode $out, ":utf8";
+print {$out} $xc->findnodes('/html:html/html:body/html:div')->[0]->toString(0);
+close ($out);
+
+$ps->update_cover_images(
+    {
+        'size' => "l",
+        'resize_to' => { 'width' => 150, 'height' => 250 },
+        'name_cb' =>
+            sub
+            {
+                my $args = shift;
+                return "$wml_dir/images/$args->{id}.jpg";
+            },
+        'amazon_token' => "0VRRHTFJECHSKYNYD282",
+        'amazon_associate' => "shlomifishhom-20",
+    }
+);
+
+1;
+

t2/humour/recommendations/films/images/princess-bride.jpg

Added
New image

t2/humour/recommendations/films/index.html.wml

+#include '../template.wml'
+
+<latemp_subject "Shlomi Fish's Films' Recommendations" />
+
+#include "prod-synd/films/include-me.html"
+

t2/humour/recommendations/films/shlomi-fish-films-recommendations.xml

+<?xml version='1.0' encoding='utf-8'?>
+<?xml-stylesheet type="text/xml" href="product-syndication.xsl"?>
+<!DOCTYPE comparison SYSTEM "product-syndication.dtd">
+<!--
+;;; To add:
+* The Princess Bride.
+* Spaceballs.
+* Eight days a week.
+* http://www.imdb.com/title/tt0095304/ - High Spirits
+* http://www.imdb.com/title/tt0103241/ - What About Bob?
+* The Neverending Story (I).
+* Star Wars IV-VI.
+* Jerry Maguire.
+* Willo and the Princess.
+* Bring it On (I)
+* The Emperor's New Groove
+* The Lion King
+* Disney's Aladdin
+* Mary Poppins.
+* The one with 
+* http://www.imdb.com/title/tt0060640/ - Dick-van-Dyke Lt. Robin Crusoe, U.S.N
+* "Speed"
+* Robin Hood - Men in Tights.
+* Robin Hood - Prince of Thieves.
+* Hot Shots I + II
+* Stand by Me.
+-->
+
+<product-syndication>
+    <data>
+        <cat id="films">
+            <title>Shlomi Fish's Films' Recommendations</title>
+            <desc appendtoc="1">
+<p>
+    This is a list of films I have watched and can recommend.
+</p>
+
+            </desc>
+            <cat id="favourite-films">
+                <title>My Favourite Films</title>
+                <desc>
+                    <p>
+                        This is a list of my favourite films.
+                    </p>
+                </desc>
+                <prod id="princess-bride">
+                    <title>The Princess Bride</title>
+                    <isbn>B00005LOKQ</isbn>
+                    <creator type="director">Rob Reiner</creator>
+                    <desc>
+
+<p>
+This is my favourite movie, and the favourite of a lot of others from
+my generation. It has an excellent dialogue, with many power sentences. The
+acting is excellent, and the film is very enjoyable.
+</p>
+
+<p>
+The Princess Bride has the format of a classic fairy tale, but with a few
+interesting and non-ordinary twists. It is funny, engaging and highly
+recommended.
+</p>
+
+                    </desc>
+                </prod>
+            </cat>
+        </cat>
+    </data>
+</product-syndication>