📄 search.rediris.in
字号:
#----------------------------------------------------------------------# JMM - 20010529# We consider some metadata in Dublin Core format the most important#---------------------------------------------------------------------, $rank = $rank + 10000 - length($line) if (index($line,"dc.subject#") > 0); $rank = $rank + 5000 - length($line) if (index($line,"dc.title#") > 0); $rank = $rank + 1000 - length($line) if (index($line,"dc.description#") > 0); $rank = $rank + 500 - length($line) if (index($line,"dc.creator#") > 0); $rank = $rank + 100 - length($line) if (index($line,"dc.publisher#") > 0); $rank = $rank + 100 - length($line) if (index($line,"dc.language#") > 0);#---------------------------------------------------------------------' #title is most important $rank += 600 - length($line)*3 if (index($line,"title#") > 0 && length($line) < 200); #url is also important $rank += 150 - length($line)/1.5 if (index($line,"url#") > 0 && length($line) < 200); #there are some very long headings... $rank += 110 - length($line)/2 if (index($line,"headings#") > 0 && length($line)<200); # used for PDF, PS etc. $rank += 80 - length($line)/3 if (index($line,"description#") > 0 && length($line)<200); $rank += 60 if (index($line,"subject#") > 0); $rank += 30 if (index($line,"images#") > 0); # these are sometimes too long. $rank += 25 - length($line)/8 if (index($line,"url-references#") > 0 ); # somehow redundant, not as important as it may seem... $rank += 20 if (index($line,"keywords#") > 0); $rank += 10 if (index($line,"body#") > 0); # Consider length of URL of every Page $rank += 400 - length($line)*2 if (index($line,"120 - ") == 0 && length($line) < 200); } $lastline = $line; } $ratings{$objnum} = $rank; $object_index[$objnum] = $objnum; $objnum++; }# pop off the "126" and "103" results (I hope they're at the end!) pop(@object_index); pop(@object_index); @sorted_index= sort byrate @object_index; $objnum=0;#----------------------------------------------------------------------# JMM - 20010605# The first element has the higher weight. We need it to calculate# the number of balls to show with an resource.#---------------------------------------------------------------------, $rGreaterWeight = $ratings{$sorted_index[0]};#---------------------------------------------------------------------' foreach $index (@sorted_index) { $OBJ[$objnum] = $objects[$index];#----------------------------------------------------------------------# JMM - 20010529# We save the weight of each object.#---------------------------------------------------------------------, $raWeight[$objnum] = $ratings{$index};#---------------------------------------------------------------------' $objnum++; }}sub byrate { $ratings{$b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8/g;s/é/\xe9/g;s/ê/\xea/g;s/ë/\xeb/g;s/ì/\xec/g;s/í/\xed/g;s/î/\xee/g;s/ï/\xef/g;s/ð/\xf0/g;s/ñ/\xf1/g;s/ò/\xf2/g;s/ó/\xf3/g;s/ô/\xf4/g;s/õ/\xf5/g;s/ö/\xf6/g;s/÷/\xf7/g;s/ø/\xf8/g;s/ù/\xf9/g;s/ú/\xfa/g;s/û/\xfb/g;s/ü/\xfc/g;s/ý/\xfd/g;s/þ/\xfe/g;s/ÿ/\xff/g; # Cougar HTMLsyms/ƒ/\\#402/g;s/Α/\\#913/g;s/Β/\\#914/g;s/Γ/\\#915/g;s/Δ/\\#916/g;s/Ε/\\#917/g;s/Ζ/\\#918/g;s/Η/\\#919/g;s/Θ/\\#920/g;s/Ι/\\#921/g;s/Κ/\\#922/g;s/Λ/\\#923/g;s/Μ/\\#924/g;s/Ν/\\#925/g;s/Ξ/\\#926/g;s/Ο/\\#927/g;s/Π/\\#928/g;s/Ρ/\\#929/g;s/Σ/\\#931/g;s/Τ/\\#932/g;s/Υ/\\#933/g;s/Φ/\\#934/g;s/Χ/\\#935/g;s/Ψ/\\#936/g;s/Ω/\\#937/g;s/α/\\#945/g;s/β/\\#946/g;s/γ/\\#947/g;s/δ/\\#948/g;s/ε/\\#949/g;s/ζ/\\#950/g;s/η/\\#951/g;s/θ/\\#952/g;s/ι/\\#953/g;s/κ/\\#954/g;s/λ/\\#955/g;s/μ/\\#956/g;s/ν/\\#957/g;s/ξ/\\#958/g;s/ο/\\#959/g;s/π/\\#960/g;s/ρ/\\#961/g;s/ς/\\#962/g;s/σ/\\#963/g;s/τ/\\#964/g;s/υ/\\#965/g;s/φ/\\#966/g;s/χ/\\#967/g;s/ψ/\\#968/g;s/ω/\\#969/g;s/ϑ/\\#977/g;s/ϒ/\\#978/g;s/ϖ/\\#982/g;s/•/\\#8226/g;s/…/\\#8230/g;s/′/\\#8242/g;s/″/\\#8243/g;s/‾/\\#8254/g;s/⁄/\\#8260/g;s/℘/\\#8472/g;s/ℑ/\\#8465/g;s/ℜ/\\#8476/g;s/™/\\#8482/g;s/ℵ/\\#8501/g;s/←/\\#8592/g;s/↑/\\#8593/g;s/→/\\#8594/g;s/↓/\\#8595/g;s/↔/\\#8596/g;s/↵/\\#8629/g;s/⇐/\\#8656/g;s/⇑/\\#8657/g;s/⇒/\\#8658/g;s/⇓/\\#8659/g;s/⇔/\\#8660/g;s/∀/\\#8704/g;s/∂/\\#8706/g;s/∃/\\#8707/g;s/∅/\\#8709/g;s/∇/\\#8711/g;s/∈/\\#8712/g;s/∉/\\#8713/g;s/∋/\\#8715/g;s/∏/\\#8719/g;s/∑/\\#8721/g;s/−/\\#8722/g;s/∗/\\#8727/g;s/√/\\#8730/g;s/∝/\\#8733/g;s/∞/\\#8734/g;s/∠/\\#8736/g;s/∧/\\#8869/g;s/∨/\\#8870/g;s/∩/\\#8745/g;s/∪/\\#8746/g;s/∫/\\#8747/g;s/∴/\\#8756/g;s/∼/\\#8764/g;s/≅/\\#8773/g;s/≈/\\#8776/g;s/≠/\\#8800/g;s/≡/\\#8801/g;s/≤/\\#8804/g;s/≥/\\#8805/g;s/⊂/\\#8834/g;s/⊃/\\#8835/g;s/⊄/\\#8836/g;s/⊆/\\#8838/g;s/⊇/\\#8839/g;s/⊕/\\#8853/g;s/⊗/\\#8855/g;s/⊥/\\#8869/g;s/⋅/\\#8901/g;s/⌈/\\#8968/g;s/⌉/\\#8969/g;s/⌊/\\#8970/g;s/⌋/\\#8971/g;s/⟨/\\#9001/g;s/⟩/\\#9002/g;s/◊/\\#9674/g;s/♠/\\#9824/g;s/♣/\\#9827/g;s/♥/\\#9829/g;s/♦/\\#9830/g; # Cougar HTMLmiscs/"/\x22/g;s/&/\x26/g;s/</\x3c/g;s/>/\x3e/g;s/Œ/\\#338/g;s/œ/\\#339/g;s/Š/\\#352/g;s/š/\\#353/g;s/Ÿ/\\#376/g;s/ˆ/\\#710/g;s/˜/\\#732/g;s/ /\\#8194/g;s/ /\\#8195/g;s/ /\\#8201/g;s/‌/\\#8204/g;s/‍/\\#8205/g;s/‎/\\#8206/g;s/‏/\\#8207/g;s/–/\\#8211/g;s/—/\\#8212/g;s/‘/\\#8216/g;s/’/\\#8217/g;s/‚/\\#8218/g;s/“/\\#8220/g;s/”/\\#8221/g;s/„/\\#8222/g;s/†/\\#8224/g;s/‡/\\#8225/g;s/‰/\\#8240/g;s/‹/\\#8249/g;s/›/\\#8250/g; return($_);}# David Hoekman Oct 1, 1997# Split search results into segments, 'n' results at a time. The value of# 'n' is set by the $perpage variable, which is defined via the 'perpageflag'# query option. Each segment is written to a separate temporary file; the# location of these files must be configured locally. This routine also# removes old temporary files, when they are older than a certain age.#sub N_at_a_time { local($more) = @_; local($previous_page, $next_page); local($tmp_prefix) = "$^T-${$}"; # prefix for temporary files # if this is the last page of results, remove old temporary files # (if $expire=3, then 3/24 sets a 3 hour expiration cycle) unless ($more) { chdir "$tmp_dir"; foreach $file (<[1-9]*-[1-9]*-[1-9]*\.html>) { unlink "$file" if -M $file > $expire/24; } } # write stored 'first' page (duplicates data sent to STDOUT/browser) if (! $current_page) { $current_page = 1; open(TEMP,">$tmp_dir/$tmp_prefix-1.html") || &fatal("<b>Error: cannot write temporary files at '$tmp_dir'!</b>"); print TEMP "<html>\n"; print TEMP &expand ($CFG{'ResultHeader'}); print TEMP @first_page; print TEMP &expand ($CFG{'ResultSetEnd'});#----------------------------------------------------------------------# JMM - 20010531# We change this lines to print the navigation bar $rNavigationBar (we# constructed it when we evaluated $CFG{'CreateNavBars'})#---------------------------------------------------------------------,# print TEMP qq{<BR>Total: $totnumber} if ($more && defined $sort); print TEMP "<p>\n<center>";# print TEMP qq{[<a href="/$tmp_www/$tmp_prefix-2.html">Next</a>]}# if $totnumber > $nobjects;# print TEMP qq{[<a href="$hp_url">New Search</a>]}# if $hp_url ne '';## print TEMP "$rNavigationBar";#---------------------------------------------------------------------' print TEMP "<p>\n</center>";#----------------------------------------------------------------------# JMM - 20010531# We use $CFG{'ResultTrailer'} to finish the page#---------------------------------------------------------------------,# print TEMP "</body></html>\n"; print TEMP &expand ($CFG{'ResultTrailer'});#---------------------------------------------------------------------' undef @first_page; } # finish off current page print &expand ($CFG{'ResultSetEnd'}) if $more; $previous_page = $current_page - 1; $next_page = $current_page + 1;#----------------------------------------------------------------------# JMM - 20010531# We print the total later#---------------------------------------------------------------------,# print qq{<BR>Total: $totnumber} if ($more && defined $sort);# print "<p>\n<center>";#---------------------------------------------------------------------'#----------------------------------------------------------------------# JMM - 20010531# We print the navigation bar#---------------------------------------------------------------------,# print qq{[<a href="/$tmp_www/$tmp_prefix-$previous_page.html">Previous</a>]}# if $previous_page > 0;# print qq{[<a href="/$tmp_www/$tmp_prefix-$next_page.html">Next</a>]}# if $totnumber > $nobjects;# print qq{[<a href="$hp_url">New Search</a>]} if $hp_url ne '';# print "</center>\n";#---------------------------------------------------------------------' print &expand ($CFG{'ResultTrailer'});#----------------------------------------------------------------------# JMM - 20010531# We use $CFG{'ResultTrailer'} to finish the page#---------------------------------------------------------------------,# print "</body>\n</html>\n";#---------------------------------------------------------------------' return unless $more; # stop here if no more results! # increment page counter, open next results page $current_page++; close(TEMP); open(TEMP,">$tmp_dir/$tmp_prefix-$current_page.html") || &fatal("<b>Error: cannot write temporary files at '$tmp_dir'!</b>"); select(TEMP); # print beginning of next page print &expand ($CFG{'ResultHeader'}); eval ($CFG{'CreateNavBars'}); print &expand ($CFG{'ResultSetBegin'});}sub ceil { my $x = shift; $x += 1.0 unless ($x == int($x)); return int($x);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -