public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in users/cam/topdocs: top.sh
@ 2007-10-10  0:27 Camille Huot (cam)
  0 siblings, 0 replies; 2+ messages in thread
From: Camille Huot (cam) @ 2007-10-10  0:27 UTC (permalink / raw
  To: gentoo-commits

cam         07/10/10 00:27:04

  Added:                top.sh
  Log:
  New: a tool to handle topdocs.xml files

Revision  Changes    Path
1.1                  users/cam/topdocs/top.sh

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/cam/topdocs/top.sh?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/cam/topdocs/top.sh?rev=1.1&content-type=text/plain

Index: top.sh
===================================================================
#!/bin/sh

# some tools to handle topdocs file

DATE="$(date +%Y%m%d)"

function get() {
 output=topdocs-${DATE}.xml
 if [ -r "$output" ]; then return; fi
 wget -O "$output" http://www.gentoo.org/proj/en/gdp/tests/topdocs.xml?passthru=1
}
function order() {
 get
 output=order-${DATE}.txt
 if [ -r "$output" ]; then return; fi
 cat topdocs-${DATE}.xml | grep "^<tr><ti>" | sed -e "s/<[^>]*>/ /g" -e "s/,//g" | awk '{ print $4" "$2 }' | sort -nr > "$output"
}
function help() {
 echo "Usage: $0 <get|order>"
 echo "ie.: $0 order to get the last list of top docs viewed on gentoo.org,"
 echo "ordered by English hits (ie. excluding translations)"
 exit
}

if [ $# -ne 1 ]; then help; fi
case "$1" in
 "get")
  get
  ;;
 "order")
  order
  ;;
 *)
  help
  ;;
esac




-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo commit in users/cam/topdocs: top.sh
@ 2007-10-10  0:41 Camille Huot (cam)
  0 siblings, 0 replies; 2+ messages in thread
From: Camille Huot (cam) @ 2007-10-10  0:41 UTC (permalink / raw
  To: gentoo-commits

cam         07/10/10 00:41:59

  Modified:             top.sh
  Log:
  Adding a function to get untranslated topdocs ordered by hits

Revision  Changes    Path
1.2                  users/cam/topdocs/top.sh

file : http://sources.gentoo.org/viewcvs.py/gentoo/users/cam/topdocs/top.sh?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/cam/topdocs/top.sh?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/cam/topdocs/top.sh?r1=1.1&r2=1.2

Index: top.sh
===================================================================
RCS file: /var/cvsroot/gentoo/users/cam/topdocs/top.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- top.sh	10 Oct 2007 00:27:04 -0000	1.1
+++ top.sh	10 Oct 2007 00:41:59 -0000	1.2
@@ -2,28 +2,44 @@
 
 # some tools to handle topdocs file
 
-DATE="$(date +%Y%m%d)"
+_DATE="$(date +%Y%m%d)"
+_LANG=fr
 
 function get() {
- output=topdocs-${DATE}.xml
+ output=topdocs-${_DATE}.xml
  if [ -r "$output" ]; then return; fi
  wget -O "$output" http://www.gentoo.org/proj/en/gdp/tests/topdocs.xml?passthru=1
 }
 function order() {
  get
- output=order-${DATE}.txt
+ output=order-${_DATE}.txt
  if [ -r "$output" ]; then return; fi
- cat topdocs-${DATE}.xml | grep "^<tr><ti>" | sed -e "s/<[^>]*>/ /g" -e "s/,//g" | awk '{ print $4" "$2 }' | sort -nr > "$output"
+ cat topdocs-${_DATE}.xml | grep "^<tr><ti>" | sed -e "s/<[^>]*>/ /g" -e "s/,//g" | awk '{ print $4" "$2 }' | sort -nr > "$output"
+}
+function metadoc() {
+ for doc in $(
+    egrep " /(doc|proj)/" order-${_DATE}.txt \
+    | grep -v handbook \
+    | sed "s/\*\*/en/" \
+    | awk '{ print $2 }'); do
+  if grep -q $doc ../../../xml/htdocs/doc/${_LANG}/metadoc.xml; then
+   echo $doc
+  fi
+ done
 }
 function help() {
- echo "Usage: $0 <get|order>"
- echo "ie.: $0 order to get the last list of top docs viewed on gentoo.org,"
- echo "ordered by English hits (ie. excluding translations)"
+ echo "Usage: $0 <get|order|metadoc>"
+ echo "get: download the plain current topdocs.xml"
+ echo "order: top docs ordered by English hits (ie. excluding translations)"
+ echo "metadoc: show top docs that are untranslated according to metadoc"
  exit
 }
 
 if [ $# -ne 1 ]; then help; fi
 case "$1" in
+ "metadoc")
+  metadoc
+  ;;
  "get")
   get
   ;;



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-10  0:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-10  0:41 [gentoo-commits] gentoo commit in users/cam/topdocs: top.sh Camille Huot (cam)
  -- strict thread matches above, loose matches on Subject: below --
2007-10-10  0:27 Camille Huot (cam)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox