slitaz-forge rev 360

mirror-search.sh: unlinearize tag cloud
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 06 13:12:32 2013 +0200 (2013-04-06)
parents d2082d27913b
children 88002a7d0351
files pkgs/Travaux.png pkgs/Travaux.sh pkgs/mirror-search.sh
line diff
     1.1 Binary file pkgs/Travaux.png has changed
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/pkgs/Travaux.sh	Sat Apr 06 13:12:32 2013 +0200
     2.3 @@ -0,0 +1,21 @@
     2.4 +#!/bin/sh
     2.5 +
     2.6 +cat <<EOT
     2.7 +Content-type: text/html
     2.8 +
     2.9 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2.10 +<html xmlns="http://www.w3.org/1999/xhtml">
    2.11 +<head>
    2.12 +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    2.13 +<title>&spades;</title>
    2.14 +</head>
    2.15 +
    2.16 +<body>
    2.17 +<table width="269" border="0" align="center">
    2.18 +  <tr>
    2.19 +    <td><img src="Travaux.png" width="269" height="269" /></td>
    2.20 +  </tr>
    2.21 +</table>
    2.22 +</body>
    2.23 +</html>
    2.24 +EOT
     3.1 --- a/pkgs/mirror-search.sh	Wed Mar 27 12:13:25 2013 +0100
     3.2 +++ b/pkgs/mirror-search.sh	Sat Apr 06 13:12:32 2013 +0200
     3.3 @@ -11,6 +11,9 @@
     3.4  # Parse query string
     3.5  . /usr/lib/slitaz/httphelper.sh
     3.6  
     3.7 +case "$HTTP_USER_AGENT" in
     3.8 +*/[Bb]ot*|*[Bb]ot/*|*spider/*) exec $PWD/Travaux.sh ;;
     3.9 +esac
    3.10  
    3.11  # User preferred language
    3.12  # parameter $1 have priority; without parameter $1 - browser language only
    3.13 @@ -278,9 +281,12 @@
    3.14  	PACKAGE_URL="http://mirror.slitaz.org/packages/$SLITAZ_VERSION/$(cd /var/www/slitaz/mirror/packages/$SLITAZ_VERSION ; ls $PACKAGE-$VERSION*.tazpkg)"
    3.15  	busybox wget -s $PACKAGE_URL 2> /dev/null &&
    3.16  	PACKAGE_HREF="<a href=\"$PACKAGE_URL\">$PACKAGE</a>"
    3.17 +	COOKER=""
    3.18 +	[ "$SLITAZ_VERSION" == "cooking" ] &&
    3.19 +	COOKER="<a href=\"http://cook.slitaz.org/cooker.cgi?pkg=$PACKAGE\">$(gettext "Cooker")</a>"
    3.20  	cat << _EOT_
    3.21  $PACKAGE_HREF $(installed_size $PACKAGE): $SHORT_DESC \
    3.22 -<a href="?receipt=$PACKAGE&amp;version=$SLITAZ_VERSION">$(gettext "Receipt")</a>
    3.23 +<a href="?receipt=$PACKAGE&amp;version=$SLITAZ_VERSION">$(gettext "Receipt")</a> $COOKER
    3.24  _EOT_
    3.25  fi
    3.26  	[ -n "$(GET debug)" ] && cat << _EOT_
    3.27 @@ -530,6 +536,8 @@
    3.28  {
    3.29  	echo "<p>"
    3.30  	while read cnt pct item ; do
    3.31 +		pct=$(((10000 - ((100 - $pct)**2))/100))
    3.32 +		pct=$(((10000 - ((100 - $pct)**2))/100))
    3.33  		cat <<EOT
    3.34  <span style="color:#99f; font-size:9pt; padding-left:5px; padding-right:2px;">\
    3.35  $cnt</span><a href="?$1=$item&amp;version=$SLITAZ_VERSION" style="\