Changeset 180 for osx

Show
Ignore:
Timestamp:
12/20/10 00:22:59 (17 months ago)
Author:
frank
Message:

Updated OS X version of global onelinerz to the latest rev.

Location:
osx/scripts/bbs-scene_global_onelinerz
Files:
2 added
5 modified

Legend:

Unmodified
Added
Removed
  • osx/scripts/bbs-scene_global_onelinerz/CHANGELOG

    r176 r180  
     12010 12-19  V2.3 Frank Linhares <admin@bbs-scene.org> 
     2 
     3    * Added configurable Alias, BBS Name and oneliner 
     4      colour options. 
     5 
     6    * Added new ansi parsing system (ansi.pl) 
     7 
     82010 12-18  V2.2.1 Frank Linhares <admin@bbs-scene.org> 
     9 
     10    * Added the ability via config option to turn ansi 
     11      in the onelinerz on or off 
     12 
     132010-12-17  V2.2 Frank Linhares  <admin@bbs-scene.org> 
     14 
     15    * oneliner.pl: Added Renegade style pipe code 
     16      support for ANSI colours. 
     17 
    1182010-11-13  V2.1 Frank Linhares  <admin@bbs-scene.org> 
    219 
     
    1229 
    1330    * onelinerz.pl: removed the need to use curl 
    14           to process xml 
     31      to process xml 
    1532 
    1633    * onelinerz.pl: created direct socket to pull 
  • osx/scripts/bbs-scene_global_onelinerz/README

    r176 r180  
    66            \/    \/     \/             \/     \/    \/     \/     \/ 
    77                 bbs-scene.org global onelinerz perl script 
    8      v2.1 by Frank Linhares aka netsurge / 13-11-10 / admin@bbs-scene.org 
     8     v2.3 by Frank Linhares aka netsurge / 19-12-10 / admin@bbs-scene.org 
    99                                 
    10                                        Install Instructions                              
     10                           Install Instructions                          
     11_ Overview _ 
     12 
     13The global onelinerz system is an Internet enabled multi bbs wall style 
     14oneliners door.  Using the bbs-scene.org api, multiple bbses can share one 
     15pool of onelinerz on their systems. Global Onelinerz supports Renegade pipe 
     16codes for adding some colour to individual onelinerz.  ANSI support can be 
     17turned on or off via the onelinerz.cfg file. 
     18 
    1119_ Prerequisites _ 
    1220 
  • osx/scripts/bbs-scene_global_onelinerz/file_id.diz

    r176 r180  
    44  /____  >\___  >___  >___|  /\___  > 
    55+<:<---\/-----\/----\/-----\/-----\/>:>+ 
    6 !     global onelinerz script v2.1     | 
     6!     global onelinerz script v2.3     | 
    77+   this perl script can be used as a  : 
    88: door to access the bbs-scene.org api + 
  • osx/scripts/bbs-scene_global_onelinerz/onelinerz.cfg

    r176 r180  
    1515 
    1616# set your bbs name below. 
     17 
    1718$bbsname    = "BBS Name"; 
    1819 
    1920# set your bbs-scene.org username below. Remember to escape the @ with a \  
     21 
    2022$username   = "email\@bbs-scene.org"; 
    2123 
    2224# set your bbs-scene.org password below. 
     25 
    2326$password   = "password"; 
    2427 
    2528# set the path to your onelinerz directory below. 
     29 
    2630$linerzpath = "/path/to/onelinerz/"; 
    2731 
    2832# set the name of the header file below. 
     33 
    2934$header     = "onelinerz.ans"; 
    3035 
    3136# Set limit of onelinerz below. 
     37 
    3238$limit      = 13; 
    3339 
     40# Set if you want ANSI Colours 1 = on / 0 = off 
     41 
     42$ansi       = 0; 
     43 
     44# Oneliner Colour. Options are: Black, Blue, Green, Cyan, Red, Magenta,  
     45# Grey, Yellow, White, Lt Grey, Lt Blue, Lt, Green, Lt Cyan, Lt Red, 
     46# Lt Magenta  
     47 
     48$lcolour    = $Ansi_Codes{'Lt Grey'}; 
     49 
     50# Alias Colour. Options are: Black, Blue, Green, Cyan, Red, Magenta,  
     51# Grey, Yellow, White, Lt Grey, Lt Blue, Lt, Green, Lt Cyan, Lt Red, 
     52# Lt Magenta  
     53 
     54$acolour    = $Ansi_Codes{'White'}; 
     55 
     56# BBS Name Colour. Options are: Black, Blue, Green, Cyan, Red, Magenta,  
     57# Grey, Yellow, White, Lt Grey, Lt Blue, Lt, Green, Lt Cyan, Lt Red, 
     58# Lt Magenta  
     59 
     60$bcolour    = $Ansi_Codes{'Lt Cyan'}; 
     61 
    3462# Set any usernames not allowed to post below. 
     63 
    3564@twit      = ("Guest","Jackass"); 
  • osx/scripts/bbs-scene_global_onelinerz/onelinerz.pl

    r176 r180  
    1616# 
    1717 
    18 # Load config 
     18# Load config and ansi set 
     19require "ansi.pl"; 
     20 
    1921my $config_file = "onelinerz.cfg"; 
    2022open CONFIG, "$config_file" 
     
    3739eval { use XML::Simple; }; 
    3840if ($@) { 
    39     print "You need the HTML::Entities module installed.\r\n"; 
     41    print "You need the XML::Simple module installed.\r\n"; 
    4042    exit; 
    4143} 
     
    4648$oheader = $linerzpath . "/" . $header; 
    4749my $url = "http://bbs-scene.org/api/onelinerz.php?limit"; 
    48 my $api = $url . "=" . $limit; 
     50my $api = $url . "=" . $limit . "&ansi=" . $ansi; 
    4951 
    5052my $xmlresponse = &bbssceneApiGet( $username, $password, $api ); 
     
    6466$xml = new XML::Simple( KeyAttr => [] ); 
    6567 
    66 &stripIllegal($xml); 
     68#&stripIllegal($xml); 
     69 
    6770 
    6871# read XML file 
    6972$data = $xml->XMLin("$xmlresponse") or die "Can't process onelinerz.xml : $!"; 
    7073 
     74 
    7175my $i = 0; 
    7276 
     
    7579 
    7680    $oneliner = 
    77         " \e[30;1m(\e[37;1m" 
     81        " \e[30;1m(" . $acolour  
    7882      . $e->{alias} 
    79       . "\e[34;1m/\e[36;1m" 
     83      . "\e[34;1m/" . $bcolour 
    8084      . $e->{bbsname} 
    81       . "\e[30;1m) \e[30;0m" 
     85      . "\e[30;1m) " . $lcolour 
    8286      . $e->{oneliner}; 
    8387 
     88    #Convert Pipe codes to Escape Codes 
     89     
     90    $oneliner =~ s/\|00/$Ansi_Codes{'Black'}/; 
     91    $oneliner =~ s/\|01/$Ansi_Codes{'Blue'}/; 
     92    $oneliner =~ s/\|02/$Ansi_Codes{'Green'}/; 
     93    $oneliner =~ s/\|03/$Ansi_Codes{'Cyan'}/; 
     94    $oneliner =~ s/\|04/$Ansi_Codes{'Red'}/; 
     95    $oneliner =~ s/\|05/$Ansi_Codes{'Magenta'}/; 
     96    $oneliner =~ s/\|06/$Ansi_Codes{'Brown'}/; 
     97    $oneliner =~ s/\|07/$Ansi_Codes{'Lt Grey'}/; 
     98    $oneliner =~ s/\|08/$Ansi_Codes{'Grey'}/; 
     99    $oneliner =~ s/\|09/$Ansi_Codes{'Lt Blue'}/; 
     100    $oneliner =~ s/\|10/$Ansi_Codes{'Lt Green'}/; 
     101    $oneliner =~ s/\|11/$Ansi_Codes{'Lt Cyan'}/; 
     102    $oneliner =~ s/\|12/$Ansi_Codes{'Lt Red'}/; 
     103    $oneliner =~ s/\|13/$Ansi_Codes{'Lt Magenta'}/; 
     104    $oneliner =~ s/\|14/$Ansi_Codes{'Yellow'}/; 
     105    $oneliner =~ s/\|15/$Ansi_Codes{'White'}/; 
     106    $oneliner =~ s/\|16/$Ansi_Codes{'Bk Black'}/; 
     107    $oneliner =~ s/\|17/$Ansi_Codes{'Bk Blue'}/; 
     108    $oneliner =~ s/\|18/$Ansi_Codes{'Bk Green'}/; 
     109    $oneliner =~ s/\|19/$Ansi_Codes{'Bk Cyan'}/; 
     110    $oneliner =~ s/\|20/$Ansi_Codes{'Bk Red'}/; 
     111    $oneliner =~ s/\|21/$Ansi_Codes{'Bk Magenta'}/; 
     112    $oneliner =~ s/\|22/$Ansi_Codes{'Bk Brown'}/; 
     113    $oneliner =~ s/\|23/$Ansi_Codes{'Bk Grey'}/; 
     114    $oneliner =~ s/\|24/$Ansi_Codes{'Black'}/; 
     115      
     116    # Limit line length  
    84117    $oneliner = substr( $oneliner, 0, 121 ); 
    85118