ardixon
6/20/2013 - 3:15 PM

Several scripts for controlling the "Dream Cheeky Message Board".

Several scripts for controlling the "Dream Cheeky Message Board".

Script must live in the same directory as these files: http://sourceforge.net/projects/leddisplayctrl/files/latest/download
#!/usr/bin/perl

use LWP::Simple;

#-------------------------------------------------
#create a variable from rss feed

$url = "http://feeds.foxnews.com/foxnews/latest/";
$content = get($url);
die "Can't GET $url" if (! defined $content);

#-------------------------------------------------
#extract headlines from variable

@arr=split("CDATA",$content); # splits content into an array

$num = 1;
$d = ' :: ';
$q = '"';

while ($num < @arr)
    {
    if ($num % 2 == 1)
        {
        $ledText = $q . substr($arr[$num], 1, 70) . $d . $q;
        
        system("LedDisplayControllerGui -NoServer -NoGui -SetSpeed 0.4 -SendText $ledText");
       # print $ledText;
        
        $num = $num + 1;
        }
    else
        {
        $num = $num + 1;
        }
    }
 
# created by Austin Dixon 2/7/2013
# clears the Led Dispaly
#! usr/local/bin/perl

$qq = '""';
system("LedDisplayControllerGui -NoServer -NoGui -DeleteRegex $qq");
# created by Austin Dixon 2/7/2013
#! usr/local/bin/perl

$end = 1;

while ($end == 1)
    {
    ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime(); # finds computer's time

    $c = ':';
    $mins = sprintf("%02d${len}", $minute);
    $time = $hour . $c . $mins;

    $q = '"';
    $ledText = $q . $time . $q;

    system("LedDisplayControllerGui -NoServer -NoGui -SetSpeed 0.4 -SendText $ledText");
    sleep(30);
    
    $qq = '""';
    system("LedDisplayControllerGui -NoServer -NoGui -DeleteRegex $qq");
    }