1 |
cam 07/10/10 00:41:59 |
2 |
|
3 |
Modified: top.sh |
4 |
Log: |
5 |
Adding a function to get untranslated topdocs ordered by hits |
6 |
|
7 |
Revision Changes Path |
8 |
1.2 users/cam/topdocs/top.sh |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/users/cam/topdocs/top.sh?rev=1.2&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/users/cam/topdocs/top.sh?rev=1.2&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo/users/cam/topdocs/top.sh?r1=1.1&r2=1.2 |
13 |
|
14 |
Index: top.sh |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo/users/cam/topdocs/top.sh,v |
17 |
retrieving revision 1.1 |
18 |
retrieving revision 1.2 |
19 |
diff -u -r1.1 -r1.2 |
20 |
--- top.sh 10 Oct 2007 00:27:04 -0000 1.1 |
21 |
+++ top.sh 10 Oct 2007 00:41:59 -0000 1.2 |
22 |
@@ -2,28 +2,44 @@ |
23 |
|
24 |
# some tools to handle topdocs file |
25 |
|
26 |
-DATE="$(date +%Y%m%d)" |
27 |
+_DATE="$(date +%Y%m%d)" |
28 |
+_LANG=fr |
29 |
|
30 |
function get() { |
31 |
- output=topdocs-${DATE}.xml |
32 |
+ output=topdocs-${_DATE}.xml |
33 |
if [ -r "$output" ]; then return; fi |
34 |
wget -O "$output" http://www.gentoo.org/proj/en/gdp/tests/topdocs.xml?passthru=1 |
35 |
} |
36 |
function order() { |
37 |
get |
38 |
- output=order-${DATE}.txt |
39 |
+ output=order-${_DATE}.txt |
40 |
if [ -r "$output" ]; then return; fi |
41 |
- cat topdocs-${DATE}.xml | grep "^<tr><ti>" | sed -e "s/<[^>]*>/ /g" -e "s/,//g" | awk '{ print $4" "$2 }' | sort -nr > "$output" |
42 |
+ cat topdocs-${_DATE}.xml | grep "^<tr><ti>" | sed -e "s/<[^>]*>/ /g" -e "s/,//g" | awk '{ print $4" "$2 }' | sort -nr > "$output" |
43 |
+} |
44 |
+function metadoc() { |
45 |
+ for doc in $( |
46 |
+ egrep " /(doc|proj)/" order-${_DATE}.txt \ |
47 |
+ | grep -v handbook \ |
48 |
+ | sed "s/\*\*/en/" \ |
49 |
+ | awk '{ print $2 }'); do |
50 |
+ if grep -q $doc ../../../xml/htdocs/doc/${_LANG}/metadoc.xml; then |
51 |
+ echo $doc |
52 |
+ fi |
53 |
+ done |
54 |
} |
55 |
function help() { |
56 |
- echo "Usage: $0 <get|order>" |
57 |
- echo "ie.: $0 order to get the last list of top docs viewed on gentoo.org," |
58 |
- echo "ordered by English hits (ie. excluding translations)" |
59 |
+ echo "Usage: $0 <get|order|metadoc>" |
60 |
+ echo "get: download the plain current topdocs.xml" |
61 |
+ echo "order: top docs ordered by English hits (ie. excluding translations)" |
62 |
+ echo "metadoc: show top docs that are untranslated according to metadoc" |
63 |
exit |
64 |
} |
65 |
|
66 |
if [ $# -ne 1 ]; then help; fi |
67 |
case "$1" in |
68 |
+ "metadoc") |
69 |
+ metadoc |
70 |
+ ;; |
71 |
"get") |
72 |
get |
73 |
;; |
74 |
|
75 |
|
76 |
|
77 |
-- |
78 |
gentoo-commits@g.o mailing list |