Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Perl: Top 10

[es] :: Perl :: Perl: Top 10

[ Pregleda: 4793 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

gagi
Dragan N.
Ottawa, Canada

Član broj: 166
Poruke: 162
*.162-202-24.mc.videotron.ca

ICQ: 28662024
Sajt: www.z8m.net


Profil

icon Perl: Top 1001.04.2001. u 20:40 - pre 279 meseci
Majsori znate gde da nadjem, perl skirptu za top 10 download. Da klasira programe po download. Znam za cgi-resources.com i tako ta sranja, ali nema nista tako sto meni treba. Probavo sam i top 100 sties skripte da editujem za top10 ali ne idem mi bas nesto za rukom....

Jos bolji bi bilo ako znate gde ima vako nesto kao na http://www.download.co.yu ono za ocjenu, top 10... sve u jednom......?


10x guys!
DDSD!
 
Odgovor na temu

ventura

Član broj: 32
Poruke: 7781
*.brick.net



+6455 Profil

icon Re: Perl: Top 1001.04.2001. u 20:58 - pre 279 meseci
pa samo napisi skriptu da ti broji httpd.acces ...
 
Odgovor na temu

gagi
Dragan N.
Ottawa, Canada

Član broj: 166
Poruke: 162
*.162-202-24.mc.videotron.ca

ICQ: 28662024
Sajt: www.z8m.net


Profil

icon Re: Perl: Top 1002.04.2001. u 00:32 - pre 279 meseci
Ja da napisem? Uvjek si ti Veki smjesan covjek bio..
Da znam kodirat, sigurno nebi nekog pito da mi da skriptu...

Pamet u uglavu!
cmoookkkkkkkk
DDSD!
 
Odgovor na temu

Gojko Vujovic
Amsterdam, NL

Administrator
Član broj: 1
Poruke: 13651



+165 Profil

icon Re: Perl: Top 1004.04.2001. u 18:35 - pre 279 meseci
Nisam video takav kompletan skript, ja sam za brojanje download-a koristio obican counter script koji je posle upisivanja novog stanja u fajl, slao:

print "Location: http://adresa.do.fajla.zip.exe.ili.sta.vec/\n\n";

Umesto onog standardnog:

print "Content-type: text/html\n\n";
print "Broj poseta: $NESTO";


E sad, ovde je bio u pitanju samo jedan fajl a ti to moras da preradis da pamti odvojeno za sve fajlove koje nudis za download..

Nadam se da sam ti barem dao ideju u kom pravcu da trazis..
 
Odgovor na temu

gagi
Dragan N.
Ottawa, Canada

Član broj: 166
Poruke: 162
*.162-202-24.mc.videotron.ca

ICQ: 28662024
Sajt: www.z8m.net


Profil

icon Re: Perl: Top 1004.04.2001. u 20:58 - pre 279 meseci
Hvala Gojko na trudu...

Imo sma vec to, super je radila skirpta. Brojala je download-e. Ali nemogu ja svaki dan da prelistam 100stranica i da gledam koja ima najvise download pa da ih klasiramo pod top10. Zato mi treba ovo, da sama skonto koliko download-a ima i da ih rasporedi po download-u. Nesto u fazonu kao top100 sities...

Jebo majku ovo niko jos izgleda nije naso...
Hvala jos jednom!
DDSD!
 
Odgovor na temu

Gojko Vujovic
Amsterdam, NL

Administrator
Član broj: 1
Poruke: 13651



+165 Profil

icon Re: Perl: Top 1004.04.2001. u 21:16 - pre 279 meseci
Aj napisi mi u kom formatu ti zapisuje broj downloada pa da probam ja da ti napisem scriptu.. Dakle reci u koliko fajlova, koji su, i kako izlgedaju (ti counteri).
 
Odgovor na temu

gagi
Dragan N.
Ottawa, Canada

Član broj: 166
Poruke: 162
*.162-202-24.mc.videotron.ca

ICQ: 28662024
Sajt: www.z8m.net


Profil

icon Re: Perl: Top 1004.04.2001. u 23:13 - pre 279 meseci
Evo pogledaj ovde naso sam sada jos nesto bolje nego obicni counter: http://www.gagi03.f2s.com/cgi-bin/top/countdowntopten.htm

Samo sada imam jedan problem, kako da sredim da nepise samo naprimer file.exe . Nego da uz to mogu da ja dodam naprimer:
"Ime programa: Ovaj program vam je odlican za..."
i tako te informacije, d anebude samo obicni file name.

Evo ti code
--------------------------------------------------------------------
:#Location and name of the CountDown Script on your server
$CountDownLocation = 'http://www.home.com/cgi-bin/top/countdown.cgi';

# This is the directory location of the file(s) that will be downloaded
$DownloadFileDir = 'http://www.home.com/file';

# This is the counter log filename
$Counter = '/web/sites/user/home/cgi-bin/top/countdown.log';

#This is the HTML output filename
$HTMLFile = '/web/sites/user/home/cgi-bin/top/countdownlog.htm';

#This is the HTML output filename for the Top Ten List only
$TopTenFile = '/web/sites/user/home/cgi-bin/top/countdowntopten.htm';

##########################################################
# No changes need to be made after these lines
##########################################################
$File = $ENV{'QUERY_STRING'};
# Strip off anything up to, and including, the last "/", if present
if ($File =~ /\//) { ($File) = $File =~ /^.*\/([^\/]+)$/g; }
$DownloadFile = "$DownloadFileDir/$File";

# Add hit to main counter

open (CNT,"+<$Counter") || &endIt;
flock (CNT,2);
seek (CNT,0,0);
@infile = <CNT>;

# This will put the hits in order from max to min for each file added
$record = 0; # Starting record in the log is always 0
$correctspot = 'N'; # Tells script if this record is the one that was hit

# Proceeds as long as the record number is less than the total
# number of records in the file and the correct record hasn't been found yet.
while (($correctspot eq 'N') && ($record <= $#infile))
{ ($count,$filename,$eol) = split(/\|/,$infile[$record]);
if ($filename eq $File) #if this is the right record, hit it, trip correctspot
{$count++;
$infile[$record] = join ("\|",$count,$filename,"\n");
$correctspot = 'Y';
}
$record++;
}
if ($correctspot eq 'N')
{ $count = 1;
$newrecord = join ("\|",$count,$File,"\n");
push @infile, $newrecord;
}

@outfile = sort {($b =~ /(\d+)/)[0] <=> ($a =~ /(\d+)/)[0]} @infile;

seek (CNT,0,0);
print (CNT @outfile);
truncate (CNT,tell(CNT));
close (CNT);

#Create HTML File - Whole List
open (Out,"+>$HTMLFile") || &endIt;
flock (Out,2);
print {Out} <<TextOut;
<html>
<head>
<title>CountDown Log File Contents</title>
</head>
<body>
<table border="0" cellspacing="4">
<tr>
<td><strong>Downloads - </strong></td>
<td><strong>File</strong></td>
</tr>
TextOut

foreach (@outfile) {
($count,$filename,$eol) = split(/\|/,$_);
print {Out} <<TextOut;
<tr>
<td align="right">$count - </td>
<td><a href="$CountDownLocation?$filename">$filename</a></td>
</tr>
TextOut
}
print {Out} <<TextOut;
</table>
<hr noshade color="#0000FF">
<p><font face="Arial" size="1">Log created with <a href="http://www.datatrendsoftware.com/cgi.html">CountDown</a> by <a href="http://www.datatrendsoftware.com">Datatrend Software</a>.</font></p></body>
</html>
TextOut

#Create HTML File - Top Ten List
open (Out,"+>$TopTenFile") || &endIt;
flock (Out,2);
print {Out} <<TextOut;
<html>
<head>
<title>CountDown Log File Top Ten List</title>
</head>
<body>
<table border="0" cellspacing="4">
<tr>
<td><strong>Downloads - </strong></td>
<td><strong>File</strong></td>
</tr>
TextOut

if ($#outfile < 9) {
for ($i = 0; $i <= $#outfile; $i++) {
($count,$filename,$eol) = split(/\|/,$outfile[$i]);
print {Out} <<TextOut;
<tr>
<td align="right">$count - </td>
<td><a href="$CountDownLocation?$filename">$filename</a></td>
</tr>
TextOut
}
} else {
for ($i = 0; $i <=9; $i++) {
($count,$filename,$eol) = split(/\|/,$outfile[$i]);
print {Out} <<TextOut;
<tr>
<td align="right">$count - </td>
<td><a href="$CountDownLocation?$filename">$filename</a></td>
</tr>
TextOut
}
}

print {Out} <<TextOut;
</table>
<hr noshade color="#0000FF">
<p><font face="Arial" size="1">Log created with <a href="http://www.datatrendsoftware.com/countdown.html">CountDown</a> by <a href="http://www.datatrendsoftware.com/cgi.html">Datatrend Software</a>.</font></p>
</body>
</html>
TextOut

print "Content-type: text/html\n";
print "Location: $DownloadFile\n\n";

sub endIt # exit on error
{ exit;
} # end endIt
--------------------------------------------

Ajde ako mozes pogledaj, pa mi javi..
Hvala ti ko bratu!



[Ovu poruku je menjao gagi dana 04-04-2001 u 11:14 PM GMT]

[Ovu poruku je menjao gagi dana 04-04-2001 u 11:18 PM GMT]
DDSD!
 
Odgovor na temu

[es] :: Perl :: Perl: Top 10

[ Pregleda: 4793 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.