File: fake_external_metadata.pl

package info (click to toggle)
streamripper 1.64.6-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,904 kB
  • sloc: ansic: 11,699; sh: 8,548; makefile: 421; perl: 34
file content (34 lines) | stat: -rwxr-xr-x 970 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /usr/bin/perl
###########################################################################
# This is an external script that I use for testing streamripper's 
# external program interface.  It implements the following:
#
#   1) Generates (random) title and artist information
#   2) Sends the information to streamripper
# 
# To invoke the script, do this:
#    streamripper URL -E "perl fake_external_metadata.pl"
#
# This script is in the public domain. You are free to use, modify and 
# redistribute without restrictions.
###########################################################################

$repno = 4;

$ts = "AAA";
$as = "001";
$title = "TITLE=$ts\n";
$artist = "ARTIST=$as\n";
while (1) {
    if ($repno-- < 0) {
	$repno = 4;
	$as++;
	$ts++;
	$title = "TITLE=$ts\n";
	$artist = "ARTIST=$as\n";
    }
    $end_of_record = ".\n";
    $meta_data = $title . $artist . $end_of_record;
    syswrite (STDOUT, $meta_data, length($meta_data));
    sleep (10);
}