🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.unix.development.network
Article #4

Re: �ʸ����������ҳ������

#4
From: �ú�ѧϰ����������
Date: Thu, 06 Nov 2003 01:52
67 lines
4086 bytes
Ŷ��ǰд��һ��������͵��Ӱ�ģ��Ǻ�

#!/usr/bin/perl

use Socket ;
use Win32API::Registry 0.21 qw( :ALL );

@code = @ARGV;

$hostname = 'broadcast.hzcnc.com';

if(length($code[0])<2) {
    @code = ('cctv1','cctv5','cctv2');
}
foreach $channel(@code) {
$path = "/play.asp?code=$channel";
$port = 80 ;
$length = 1024;

socket(SOCK,AF_INET,SOCK_STREAM,(getprotobyname('tcp'))[2])
|| &prodie("Couldn't create socket: $!");

($name,$aliaes,$nametype,$namelen,@addrs) = gethostbyname($hostname);

$remotehost = pack_sockaddr_in($port, $addrs[0]) ;

connect(SOCK,$remotehost) || &prodie("Couldn't connect to $host:$port: $!") ;
send(SOCK,"GET $path HTTP/1.1\n",0);
send(SOCK,"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*\n",0);
send(SOCK,"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\n",0);
send(SOCK,"Host: $hostname\n\n",0);
$readbyte = recv(SOCK, $ret, $length, 0);
#print $ret;
if(($ret=~/href = \"\w+:\/\/(.+)\"/) or ($ret=~/HREF = \"\w+:\/\/(.+)\"/)) {
    $url = 'mms://'.$1;
    
    $keylocal = "SYSTEM\\CurrentControlSet\\Services\\nsunicast\\Parameters\\Virtual Roots\\/$channel"; 
    RegOpenKeyEx( HKEY_LOCAL_MACHINE, $keylocal, 0, KEY_ALL_ACCESS, $key );
    if(!$key) {print "Can't open $keylocal: ".regLastError()."\n";next;}
    RegSetValueEx( $key, "Path", 0, REG_SZ, "$url");
    RegCloseKey( $key );
    
    open(OUTPUT,">$channel.reg");
    print OUTPUT"Windows Registry Editor Version 5.00\n";
    print OUTPUT"[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\nsunicast\\Parameters\\Virtual Roots\\/$channel]\n";
    print OUTPUT"\"Path\"=\"$url\"\n";
    print OUTPUT"\"MaxBandwidth\"=dword:ffffffff\n";
    print OUTPUT"\"MaxClients\"=dword:ffffffff\n";
    
    print "$channel\n";
    close(OUTPUT);
} 


�� �� lbbw@smth.org (���ϴ���) �Ĵ������ᵽ: ��
:    �ܷ�˵����ϸһ�㣬�����������𣿶�л
: �� �� wy.bbs@bbs.hziee.edu.cn (�ú�ѧϰ����������) �Ĵ������ᵽ: ��
: : ��perl�ű������


--
��������������������������������������������������������������������������
       �q�������������������������������r             ����\\\
       ��   ��Ҫ�����ú���             ��    O  ��     ��-��--�r
       ��         �ú�ѧϰ  ��������   �� ��            ��
��������������������������������������������������������������������������
�� ��Դ:��Χ¯ҹ�� bbs.hziee.edu.cn��[FROM: 192.168.100.9] 
Technical Details
Message-ID: <499fhL$1LZ@bbs.hziee.edu.cn>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!news.linkpendium.com!news-out.visi.com!petbe.visi.com!newsfeeds-atl2!c03.atl99!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!HZIEE

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB
X-Google-Thread: 109ae0,5b2e2ecf23d374a7
X-Google-Attributes: gid109ae0,public
X-Google-ArrivalTime: 2003-11-05 01:52:48 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!news.linkpendium.com!news-out.visi.com!petbe.visi.com!newsfeeds-atl2!c03.atl99!sjc70.webusenet.com!news.webusenet.com!maily.cic.tsinghua.edu.cn!news.ccie.net.cn!HZIEE
From: wy.bbs@bbs.hziee.edu.cn (�ú�ѧϰ����������)
Newsgroups: cn.bbs.comp.unix.development.network
Subject: Re: �ʸ����������ҳ������
Date: 06 Nov 2003 01:52:12 GMT
Organization: Χ¯ҹ��
Message-ID: <499fhL$1LZ@bbs.hziee.edu.cn>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: UNP/M.1068083493.A
Lines: 67