diff -r 839377eedc2b -r befca0ec475f tsrc/testing/tools/genVideoFeed.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/testing/tools/genVideoFeed.pl Wed Sep 01 12:30:28 2010 +0100 @@ -0,0 +1,156 @@ +# +# Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + + +#------------------------------------------------------------------------------------ +# Includes +#------------------------------------------------------------------------------------ +#use strict; +use warnings; +use Cwd; # for cwd +use FindBin; # for FindBin:Bin +use File::Path; # for mkpath +use Date::Calc; + +#------------------------------------------------------------------------------------ +# GLOBAL CODE +#------------------------------------------------------------------------------------ + + +my $xmlStart = "\n" . +"\n" . +"\t\n"; + +my $xmlItem = +"\t\n" . +"\t\t\n" . +"\t\tXMLTITLE\n" . +"\t\tXMLURL\n" . +"\t\n"; + +my $xmlEnd = +"\t\n" . +"\n"; + +my $argcount = scalar(@ARGV); +my $paramFileName = ""; +my $paramOutFileName = ""; + +if(scalar(@ARGV) < 2) +{ + print("Usage: perl genVideoFeed.pl \n"); + print("Infile is list of videos with url and title are separated by comma\n"); + exit(); +} + +while(scalar(@ARGV) >= 1) +{ + $paramFileName = shift(@ARGV); + $paramOutFileName = shift(@ARGV); +} + +# Read TXT + +if( !open(FILE_HANDLE, $paramFileName) ) +{ + print("ERROR! Could not open file '" . $paramFileName . "'\n"); + return 0; +} +my @array = ; +close(FILE_HANDLE); + +# Write XML + +if(!open(FILE_HANDLE, ">" . "$paramOutFileName") ) +{ + print("ERROR! Could not open file for writing '" . "$paramOutFileName" . "'\n"); + return 0; +} + +print FILE_HANDLE ("$xmlStart"); + +my $line; +$line = $array[0]; +RemoveWhiteSpaces(\$line); +print FILE_HANDLE ("$line\n"); + +for(my $i=1; $i/$txtgt/g; + + ${$text} =~ s/Ä/Ä/g; + ${$text} =~ s/ä/ä/g; + ${$text} =~ s/Ö/Ö/g; + ${$text} =~ s/ö/ö/g; + + #ä ä + +# Ö Ö + +# ö ö + +}