🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #82196

Re: Geordie

#82196
From: Jurriaan (note: this is a workin...
Date: Mon, 30 Jul 2001 18:04
310 lines
13757 bytes
On Mon, 30 Jul 2001 05:27:56 GMT, fD
<flamedogg@hotmail.com> wrote:
> planb@newsreaders.com (J.B. Moreno) wrote in 
> news:1exc3to.1a2o2ii1j4vbggN%planb@newsreaders.com:
> 
>> Christopher Jahn <xjahn@netscape.net> wrote:
>> 
>> I don't recall for certain whether it does or doesn't (I think it does),
>> but you don't need to be able to view it to be able to include it: all
>> you need to be able to do is include a custom header.
> 
> Yes, but what fun is that? ;)

Slrn can do it, even without X11. Be warned, this script only works in
0.9.7.1pl2 and up, since it uses popup_window() in s-lang.

Use this slang macro:

===================================
% This function shows a X-Face in the current article.
define show_xface() 
{
   save_current_article("/tmp/art_xfce");

   variable header_file, xfce_file;
   variable fp, xfce_fp;
   variable line, face;
   
   fp = fopen ("/tmp/art_xfce", "r");
   if (fp == NULL)
     return;

   while (-1 != fgets (&line, fp))
     {
        % X-Face can appear anywhere, even in the subject line
        % and I've seen it CaPitaLizED differently, even.
        % Compare first 7 characters of line with X-FACE:
        if (strncmp(substr(strup(line), 1, 7), "X-FACE:", 7) == 0)
          {
            xfce_fp = fopen("/tmp/hdr_xface", "w");
            if (xfce_fp == NULL)
              return;
            () = fputs(line, xfce_fp);
            () = fputs("\n", xfce_fp);
            () = fclose(xfce_fp);
          
%            () = system ("cat /tmp/hdr_xface | view-x-face | less; rm -f /tmp/hdr_xface");
            () = system ("cat /tmp/hdr_xface | view-x-face > /tmp/rslt_xface; rm -f /tmp/hdr_xface");
            face = "";
            xfce_fp = fopen("/tmp/rslt_xface", "r");
            if (xfce_fp == NULL)
              return;
            while (fgets(&line, xfce_fp) != -1)
            {
               face = strcat(face, line);
            }
            () = fclose(xfce_fp);
            popup_window("X-Face:", face);
            break;
          }
     }

   () = system ("rm -f /tmp/art_xfce /tmp/hdr_xface /tmp/rslt_xface");
   % No need to close files unless we want to check for errors.  When
   % file pointer variables go out of scope, slang will close the file.
}

definekey ("show_xface", "v", "article");
===================================

Where you, of course, need the script view-x-face, which is:

===================================   
#! /bin/sh
#
# $ Id: view-x-face,v 2.0 1998/10/27 10:20:58 roland Exp roland $
#
# Read a mail message on stdin and display X-Face, if one exists.
#
# See http://www.spinnaker.de/mutt/view-x-face for new versions.
#
# This is not the optimal way to implement X-Face support into a mailreader,
# but this works for me. I bound it to "ESC f" in my muttrc with the
# following command:
#  macro        pager   \ef     "|view-x-face\n"
#
# This script needs the following tools:
# uncompface from the compface package, which can be found at 
#            ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z
# icontopbm  from the pbmplus or netpbm package, which you will find
#            everywhere on the net.
# A pbm viewer, e.g. xli, xv or if you don't have X11 running, you may want
#            to try out image2ascii, a little Shell script, which uses 
#            ImageMagick to convert nearly any graphics file to ASCII.
#            have a look at http://www.spinnaker.de/mutt/image2ascii
#
#########################################################################
#
#   Based on an idea of Ralf D�blitz <Doeblitz@gmx.de>
#
#   Copyright (C) 1997-1998  Roland Rosenfeld <roland@spinnaker.de>
#
#   This program is free software; you can redistribute it and/or
#   modify it under the terms of the GNU General Public License as
#   published by the Free Software Foundation; either version 2 of
#   the License, or (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#   General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#########################################################################

# Used programms:
UNCOMPFACE=uncompface   # from compface package
ICONTOPBM=icontopbm     # from pbmplus/netpbm package

# Image viewer (should be able to read from stdin!): 
VIEWER="small_image2ascii -geometry 48x48"

if [ -z "$@" ]
then
   file=/tmp/view-xface_$$
   cat - > $file
   delete=1
else
   file=$1
   delete=0
fi
full_header=`grep -ic "^X-Face: " $file`
if [ $full_header -gt 0 ]
then
   grep -i "^X-Face: " $file | head -1 | cut -c9- \
   | tee -a ~/xface.tmp \
   | { echo '/* Width=48, Height=48 */'; $UNCOMPFACE; } \
   | $ICONTOPBM \
   | $VIEWER
else
   cat $file \
   | { echo '/* Width=48, Height=48 */'; $UNCOMPFACE; } \
   | tee -a ~/xface.tmp \
   | $ICONTOPBM \
   | $VIEWER
   echo $@
fi
if [ $delete -gt 0 ]
then
   rm $file
fi
exit 0
===================================   

and where small_image2ascii is a slight adaptation of the image2ascii
script mentioned above:

===================================   
#! /bin/sh
#
# $ Id: image2ascii,v 1.5 1999/11/27 18:07:41 roland Exp $
#
# Convert any image to an ASCII-graphic using ImageMagick
#
##########################################################################
#
#   Copyright (C) 1997-1999  Roland Rosenfeld <roland@spinnaker.de>
#
#   This program is free software; you can redistribute it and/or
#   modify it under the terms of the GNU General Public License as
#   published by the Free Software Foundation; either version 2 of
#   the License, or (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#   General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
##########################################################################

CONVERT=convert         # The ImageMagick convert binary
PBMTOASCII=pbmtoascii   # The NetPBM pbmtoascii binary

umask 077

tmpdir=${TMPDIR-/tmp}/image2ascii.$$
mkdir $tmpdir || exit 1
trap "rm -rf $tmpdir; exit" 0 1 2 3 15

TMPFILE=$tmpdir/image

usage="Usage: $0 [option] [imagefile]

   -help                display this help text
   -geometry 132x50     define the size of the ascii image"


# set default geometry to display width:
geometry=`stty size </dev/tty | awk '{print $2 "x" ( $1 - 1) }'`

# test if stty did not output a useful value:
case "$geometry" in
        0x0 ) geometry=80x24 ;;
        ""  ) geometry=80x24 ;;
esac

case $# in 
        0 ) cat > $TMPFILE ;;
        1 ) case "$1" in
                    -* ) echo "$usage"; exit 0 ;;
                    * )  cat $1 > $TMPFILE ;;
            esac ;;
        2 ) case "$1" in
                    -geometry ) geometry=$2
                                cat > $TMPFILE ;;
                    * )         echo "$usage"; exit 0 ;;
            esac ;;
        3 ) case "$1" in
                    -geometry ) geometry=$2
                                cat $3 > $TMPFILE ;;
                    * )         echo "$usage"; exit 0 ;;
            esac ;;
        * ) echo "$usage"; exit 0 ;;
esac

# multiply x with 1 and y with 2 (pbmtoascii divides by 2x4)
geometry=`echo $geometry | awk -Fx '{print 1*$1 "x" 2*$2}'`

$CONVERT -geometry $geometry $TMPFILE $TMPFILE.pbm
$PBMTOASCII -1x2 < $TMPFILE.pbm
===================================   

Here's a screen dump (133x54 characters, use an unproportional font!)
===================================   
slrn 0.9.7.1jwk-pl2 ** Press '?' for help, 'q' to quit. ** Server: /var/spool/news/slrnpull/news
 1! -  3000   90:[Faux_Pseudo ]    Re: [slrn] feature request
 2! -  2000   23:[J.B. Moreno ]   ���Re: Geordie
 3! -  2000   27:[fD          ]    � ��>
 4! -  2000   16:[Thomas Weinb]    ��>
 5! -  2000    9:[zolderkamer@]  3 What's the best way to setup NewsPro for a Newsfeeds PremiumPlus account?





 [7/7 unread] Group: news.software.readers                                                                        -- 3/5 (All)
Newsgroups: news.software.readers
Subject: Re: Geordie
From: fD <flamedogg@hotmail.com>
X-Face:                                   �[X-Face:]��������������������������������������Ŀ
  %8=mmAAFvK^.+sI[NQr`@AKy8U:=hw:eip].hZR"�MMMMMMMMMMMMMMMM""""""""MMMMMMMMMMMM"""MMMMMMMMM�jsW+ZR@~d<r{F4_>iRd!kp!.J}>N&|byZ!5;`44f|
 *a=lZc[CC,EgWj;sndR|W_zT#SFm72sC^nhN~!GTA�MMMMMMMMMMM""              "MMMM"o      "MMMMMMM�
                                          �""""MMMMM"                   ""oMo"o      MMMMMM�
planb@newsreaders.com (J.B. Moreno) wrote �     ""Mo                       "MMo"o     MMMMM�
news:1exc3to.1a2o2ii1j4vbggN%planb@newsrea�        ""                        "o"oM    MMMMM�
                                          �                            ooMMMMo M"o"   MMMMM�
> Christopher Jahn <xjahn@netscape.net> wr�   oo                       "      " Mo    MMMMM�
>                                         �   M""o      ooooMMMMMMo      oM"""""oM    MMMMM�
>> And it came to pass that Des Coughlan w�   M"M      "         """    M   oo   M"   MMMMM�
>>                                        �   M" "        o"""""  o    MMooMM"Mo M"o  "MMMM�
>> > Christopher Jahn <xjahn@netscape.net>�   "o""       ooooooooM"   oMMMMMMooM M"o   MMMM�
>> > picts in their headers-              �    "o"     o"""""""""       ""MMMMM"oM"o"   MMM�
>> >> It's called Xface.  All you need is �     "M    oo"""""""oo          MM""MM""Mo    "M�
>> >> you can have one, too.              �      "oo""           "     oooooMMo     "Mo   "�
>> >                                      �       M                 ooMMMMM""MMMMo    M    �
>> > Does slrn ?                          �        M     o"""     oMMMMMMMMM   MMMM o M    �
>>                                        �o o     M    M"M       MMMMMMMMMMMo "MMMM"oM    �
>> Are you seeing little faces on some of � o o"   M    "o "o     MMMMMMMMMMMMMMMMM oM     �
>>                                        �         Moo     "M     "MMMMMMMMMMMMMMM MM"o   �
>> If you don't, then it doesn't.         �         MMMMo    "o      ""MMMMMMMMMM"oM"o"o   �
>                                         �         MMMMMMoo   "o               oMMMMoMoooM�
> I don't recall for certain whether it do�        MMMMMMMMMMMoo "oo       oooM"oMMMMMMMMMM�
> but you don't need to be able to view it�o     oMMMMMMMMMMMMMMMo  """"""""  oMMMMMMMMMMMM�
> you need to be able to do is include a c�MMMMMMMMMMMMMMMMMMMMMMMMMoooooooooMMMMMMMMMMMMMM�
                                          ��������������������������������������[All]�������
Yes, but what fun is that? ;)
--
fLameDogg
my hotmail account is for research purposes only.
swap hot with torch to e-maul me.

~
~
~
~
~
 93818 : Re: Geordie                                                                                              -- 1/35 (All)
Use UP/DOWN to move, any other key to exit
===================================   

It may not be much, but you can see what he meant by the comment about
his nose (sorry for that!).

Jurriaan


-- 
'Name any tree that you love and it shall stand till it
dies,' said Aldarion. 'I love all that grow in this Isle,'
said Erendis.
	JRR Tolkien - Unfinished Tales
GNU/Linux 2.4.7-ac2 SMP/ReiserFS 2x1402 bogomips load av: 0.11 0.08 0.06
Technical Details
Message-ID: <slrn9maf94.2sg.no_spam_here@middle.of.nowhere>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!transit.news.xs4all.nl!not-for-mail
References: <Xns90EDE5773BE7lodewayhotmailcom@195.8.69.79> <Xns90EDB34B9AEE3xjahn@24.129.0.136> <slrn9m96uo.8cd.desmond@lievre.voute.net> <Xns90EDCFDB8B19Fxjahn@24.129.0.136> <1exc3to.1a2o2ii1j4vbggN%planb@newsreaders.com> <Xns90EE60CBE515imamidnighttoken@65.82.44.7>

Show Full Headers
Complete Article Headers
Message-ID: <slrn9maf94.2sg.no_spam_here@middle.of.nowhere>
Subject: Re: Geordie
Date: Mon, 30 Jul 2001 18:04:35 +0000
From: "Jurriaan (note: this is a working address!)" <no_spam_here@rivierenland.xs4all.nl>
References: <Xns90EDE5773BE7lodewayhotmailcom@195.8.69.79> <Xns90EDB34B9AEE3xjahn@24.129.0.136> <slrn9m96uo.8cd.desmond@lievre.voute.net> <Xns90EDCFDB8B19Fxjahn@24.129.0.136> <1exc3to.1a2o2ii1j4vbggN%planb@newsreaders.com> <Xns90EE60CBE515imamidnighttoken@65.82.44.7>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!transit.news.xs4all.nl!not-for-mail
Newsgroups: news.software.readers
Organization: XS4ALL Internet BV
Lines: 309
NNTP-Posting-Host: rivierenland.xs4all.nl
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news1.xs4all.nl 996516275 8362 194.109.14.47 (30 Jul 2001 18:04:35 GMT)
X-Complaints-To: abuse@xs4all.nl
NNTP-Posting-Date: 30 Jul 2001 18:04:35 GMT
X-Face: b$-F+98,@$_I=*ODq'<K2(OA)qC&,(GP=z2^`4dwQwy&e;!|R?>")k9FH3?YC+%*kF\=<Rx"Hy2_eyMtnFSiO8
User-Agent: slrn/0.9.7.1jwk-pl2 (Linux)