1#! /usr/bin/perl 2########################################################################### 3# This is an external script that I use for testing streamripper's 4# external program interface. It implements the following: 5# 6# 1) Generates (random) title and artist information 7# 2) Sends the information to streamripper 8# 9# To invoke the script, do this: 10# streamripper URL -E "perl fake_external_metadata.pl" 11# 12# This script is in the public domain. You are free to use, modify and 13# redistribute without restrictions. 14########################################################################### 15 16$repno = 4; 17 18$ts = "AAA"; 19$as = "001"; 20$title = "TITLE=$ts\n"; 21$artist = "ARTIST=$as\n"; 22while (1) { 23 if ($repno-- < 0) { 24 $repno = 4; 25 $as++; 26 $ts++; 27 $title = "TITLE=$ts\n"; 28 $artist = "ARTIST=$as\n"; 29 } 30 $end_of_record = ".\n"; 31 $meta_data = $title . $artist . $end_of_record; 32 syswrite (STDOUT, $meta_data, length($meta_data)); 33 sleep (10); 34} 35