#71163 - 2002-10-27 03:15 PM
Re: udf-link collector
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
yeah yeah yeah. how to remove those un-udf topics? can't mask with "()" nor "-" as all udf topic titles do not have them...
anyway, my current lister:
code:
$udfLibrary = createobject("microsoft.xmlhttp") $udfLibrary.open("GET","http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=forum&f=12&DaysPrune=1000&submit=Go",not 1) $udfLibrary.send $pages=$udfLibrary.responsetext $pages=substr($pages,instr($pages,"Page: 1")) $pages=left($pages,instr($pages,chr(10))-3) $pages=substr($pages,instrrev($pages,">")+1) $pages=val(trim(left($pages,instr($pages,"<")-1))) del @scriptdir+"\listUDF"+".htm" $=open(1,@scriptdir+"\listUDF"+".htm",5)
for $c=0 to $pages-1 $udfLibrary.open("GET","http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=forum;f=12;hardset=1000;start_point="+($c*25) ,not 1) $udfLibrary.send $page=$udfLibrary.responsetext $page=split($page,'<a href="http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=') for $=1 to ubound($page) $line=left($page[$],instr($page[$],"</a>")+3)+"</td><td>" if instr($line,";p=") $line="" endif $page[$]=substr($page[$],instr($page[$],'<font size="2" face="Verdana, Helvetica, sans-serif">')+54) if instr($page[$],"</font>") $list=$list+left($line+$page[$],instr($line+$page[$],"</font>")-1)+chr(10) else $list=$list+$line endif next next
$list=split($list,chr(10))
;sorting routine for $c=0 to ubound($list) if instr($list[$c],'">') $line=split($list[$c],'">') $list[$c]=$line[1],$line[0] $list[$c]=join($list[$c],'">') endif next $list=qs($list) for $c=0 to ubound($list) if instr($list[$c],'">') $line=split($list[$c],'">') $list[$c]=$line[1],$line[0] $list[$c]=join($list[$c],'">') endif next
;write to file $c=0 ;count udf's too $=writeline(1,'<table><th>UDF</th><th>Author</th>') for each $line in $list $c=$c+1 $=writeline(1,'<tr><td><a href="http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t='+$line+'</td></tr>') next $=writeline(1,'</table><br>Total Count: $c') $=close(1)
;QS() -quicksort function by brianTX function qs($a) DIM $b[32],$c[32],$d,$e,$f,$g,$h,$i,$j,$k,$l $b[0]=0 $c[0]=UBOUND($a) $d=0 While $d >=0 $e=$b[$d] $f=$c[$d] While $e < $f $h=$e+($f-$e)/2 $k=$a[$e] $A[$e]=$A[$h] $A[$h]=$k $i=$e+1 $j=$f $l=0 Do While ($i<$j) AND $A[$e] > $A[$i] $i=$i+1 Loop While ($j>=$i) AND $A[$j] > $A[$e] $j=$j-1 Loop IF $i>=$j $l=1 ELSE $k=$A[$i] $A[$i]=$A[$j] $A[$j]=$k $j=$j-1 $i=$i+1 ENDIF Until $l=1 $k=$a[$e] $a[$e]=$a[$j] $a[$j]=$k $g=$j If $g-$e <= $f - $g If $g+1 < $f $b[$d]=$g+1 $c[$d]=$f $d=$d+1 Endif $f=$g-1 Else If $g-1 > $e $b[$d]=$e $c[$d]=$g-1 $d=$d+1 Endif $e=$g+1 Endif Loop $d=$d-1 Loop $qs=$a Endfunction
added counter. [ 27. October 2002, 15:42: Message edited by: Lonkero ]
_________________________
!download KiXnet
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 3139 anonymous users online.
|
|
|