/[kvake]/kvake.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /kvake.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Fri Apr 14 06:03:02 2000 UTC (22 years, 7 months ago) by dpavlin
Branch: MAIN
Changes since 1.1: +24 -17 lines
File MIME type: text/plain
Hana: sada ignorira sve sto ^eng$, ^eng_ , ^adresar$ u imenu direktorija

1 #!/usr/local/bin/perl -w
2 #
3 # program pretvara ch, zh, sh, cc, dh u odgovrajuce
4 # ISO 8859-2 znakove
5 # ozujak 1998.
6 # Hana Breyer Priselac
7 #
8 # poziva se s ./kvake.sh PUT
9 # gdje je PUT puni UNIX path do html dokumenata koje
10 # konvertirate
11 #
12 # 2000-02-16 Dobrica Pavlinusic <dpavlin@pliva.hr> prva perl verzija
13 # 2000-03-01 DbP poravljen ignore_dirs grep bug
14 #
15 # 2000-03-31 Hana sada ignorira sve sto ^eng$, ^eng_ , ^adresar$ u imenu direktorija
16
17 $mod_time = 10*60; # 10 minuta
18 #$mod_time = 24*60*60; # 1 day
19
20 $verbose = 0;
21
22 #@ignore_dirs=( "/data/web/public/adresar/", "/data/web/public/eng" );
23
24 if (! defined(@ARGV)) {
25 @dirs=( "/data/web/public",
26 "/usr/users/it/dpeterc" );
27 } else {
28 @dirs=@ARGV;
29 }
30
31 foreach $dir (@dirs) {
32 opendir(DIR,"$dir") || warn "can't open $dir: $!";
33 foreach $f (grep { !/^\./ } readdir(DIR)) {
34 if (-d "$dir/$f" && $f !~ /^eng$/ && $f !~ /^adresar$/ && $f !~ /^eng_/) {
35 $push_it = 1;
36 push @dirs,"$dir/$f" if ($push_it);
37 }
38 elsif (-f "$dir/$f" && ! -l "$dir/$f") {
39 @stat = stat(_);
40 if ($f =~ /\.html/ && (time() - $stat[9]) < $mod_time) {
41 print "filek za mjenjanje `$dir/$f\n" if ($verbose);
42 push @files,"$dir/$f";
43 }
44 else {
45 print "ovo je staro: $dir/$f\n" if ($verbose);
46 }
47 }
48 elsif ($f =~ /^eng$/ || $f =~ /adresar/ || $f =~ /^eng_/) {
49 print "preskacem jer je eng ili adresar $dir/$f\n" if ($verbose);
50 }
51 else {
52 print "ovo je link $dir/$f\n" if ($verbose);
53 }
54 }
55 closedir DIR;
56 }
57
58 foreach $file (@files) {
59 if (open(IN,"$file")) {
60 print "$file\n" if ($verbose);
61 if (open(OUT,"> $file.$$")) {
62 while(<IN>) {
63 replace();
64 print OUT "$_";
65 }
66 } else {
67 warn "can't open $file.$$: $!";
68 }
69 close(OUT);
70 } else {
71 warn "can't open $file for reading: $!";
72 }
73 close(IN);
74 @stat = stat($file);
75 rename "$file.$$","$file";
76 chmod 0664,"$file";
77 # chmod $stat[2],"$file";
78 chown $stat[4],$stat[5],"$file";
79 }
80
81 1;
82
83 sub replace {
84
85 s/ch/è/g; s/CH/È/g;
86 s/cc/æ/g; s/CC/Æ/g;
87 s/zh/¾/g; s/ZH/®/g;
88 s/sh/¹/g; s/SH/©/g;
89 s/dh/ð/g; s/DH/Ð/g;
90
91 s/ ÈN / CHN /g;
92 s/18th IÆ Sto/18th ICC Sto/g;
93 s/aæepted/accepted/g;
94 s/aæount/account/g;
95 s/aæumulated/accumulated/g;
96 s/Aæount/Account/g;
97 s/Aæess/Access/g;
98 s/aèieved/achieved/g;
99 s/anèor/anchor/g;
100 s/ANÈOR/ANCHOR/g;
101 s/approaèing/approaching/g;
102 s/Batè/Batch/g;
103 s/BATÈ/BATCH/g;
104 s/Bayerisèe/Bayerische/g;
105 s/Beeèam/Beecham/g;
106 s/BEEÈAM/BEECHAM/g;
107 s/Bioteè/Biotech/g;
108 s/infoteè/infotech/g;
109 s/Blue èip/Blue chip/g;
110 s/Boæoni/Bocconi/g;
111 s/BRONÈITIS/BRONCHITIS/g;
112 s/ÈANGE/CHANGE/g;
113 s/èange/change/g;
114 s/èaracteris/characteris/g;
115 s/ÈARACTERISTICS/CHARACTERISTICS/g;
116 s/èart /chart /g;
117 s/-èart/-chart/g;
118 s/ca¹/cash/g;
119 s/ca¹less/cashless/g;
120 s/èarset/charset/g;
121 s/èeck/check/g;
122 s/Cellteè/Celltech/g;
123 s/èemi/chemi/g;
124 s/ÈEMI/CHEMI/g;
125 s/èemotherapy/chemotherapy/g;
126 s/èildbearing/childbearing/g;
127 s/ÈILDREN/CHILDREN/g;
128 s/ÈIRON/CHIRON/g;
129 s/ÈLAMIDIA/CHLAMIDIA/g;
130 s/ÈLAMYDIAL/CHLAMYDIAL/g;
131 s/èool/chool/g;
132 s/ÈROMOS/CHROMOS/g;
133 s/ÈRONIC/CHRONIC/g;
134 s/èronic/chronic/g;
135 s/Daiièi/Daiichi/g;
136 s/Deutsè/Deutsch/g;
137 s/Doxyæline/Doxyccline/g;
138 s/dkatèalkov/dkatchalkov/g;
139 s/ eaè / each /g;
140 s/eandryusèenko/eandryuschenko/g;
141 s/einriè/einrich/g;
142 s/ekarta¹eva/ekartasheva/g;
143 s/Engli¹/English/g;
144 s/engli¹/english/g;
145 s/esterreiè/esterreich/g;
146 s/FINI©ED/FINISHED/g;
147 s/FRE©/FRESH/g;
148 s/fre¹/fresh/g;
149 s/Gold¹ield/Goldshield/g;
150 s/gonocoæal/gonococcal/g;
151 s/Hoeèst/Hoechst/g;
152 s/IFSÆ/IFSCC/g;
153 s/ilev¹in/ilevshin/g;
154 s/i¹oðenje/ishoðenje/g;
155 s/i¹oditi/ishoditi/g;
156 s/i¹ode/ishode/g;
157 s/Itaèa/Itacha/g;
158 s/Karpisèenko/Karpischenko/g;
159 s/LAÈEM/LACHEM/g;
160 s/Laèem/Lachem/g;
161 s/Leader¹ip/Leadership/g;
162 s/LYNÈ/LYNCH/g;
163 s/loæo/locco/g;
164 s/acinto¹/acintosh/g;
165 s/meèanis/mechanis/g;
166 s/MACINTO©/MACINTOSH/g;
167 s/matèing/matching/g;
168 s/Ma¹killeyson/Mashkilleyson/g;
169 s/medwatè/medwatch/g;
170 s/Merèant/Merchant/g;
171 s/Mièele/Michele/g;
172 s/Munèen/Munchen/g;
173 s/Osterreiè/Osterreich/g;
174 s/Pa¹kova/Pashkova/g;
175 s/PUBLI©ED/PUBLISHED/g;
176 s/purèas/purchas/g;
177 s/Relaunè/Relaunch/g;
178 s/relaunè/relaunch/g;
179 s/riè/rich/g;
180 s/Rièter/Richter/g;
181 s/Rièard/Richard/g;
182 s/riti¹/ritish/g;
183 s/Roèe/Roche/g;
184 s/Rytèik/Rytchik/g;
185 s/Savièeva/Savicheva/g;
186 s/Sèauer/Schauer/g;
187 s/Sèonwald/Schonwald/g;
188 s/sèeduling/scheduling/g;
189 s/sèen/schen/g;
190 s/Sè/Sch/g;
191 s/SÈ/SCH/g;
192 s/Sèering/Schering/g;
193 s/Sèleswig/Schleswig/g;
194 s/Sèmidt/Schmidt/g;
195 s/SÈMIDT/SCHMIDT/g;
196 s/SEARÈ/SEARCH/g;
197 s/Searè/Search/g;
198 s/searè/search/g;
199 s/Straèounsky/Strachounsky/g;
200 s/¹are/share/g;
201 s/¹ea/shea/g;
202 s/¹ell/shell/g;
203 s/¹eet/sheet/g;
204 s/¹ema/shema/g;
205 s/©EMA/SHEMA/g;
206 s/¹ip/ship/g;
207 s/¹odno/shodno/g;
208 s/¹op/shop/g;
209 s/©ORT/SHORT/g;
210 s/¹ort-term/short-term/g;
211 s/ ¹own / shown /g;
212 s/ ¹ows / shows /g;
213 s/¹ridge/shridge/g;
214 s/¹vaæa/shvaæa/g;
215 s/¹vate/shvate/g;
216 s/©;.GIF/SH;.GIF/g;
217 s/¹;.html/sh;.html/g;
218 s/exèange/exchange/g;
219 s/SUÆESSFUL/SUCCESSFUL/g;
220 s/SUPERFRE©/SUPERFRESH/g;
221 s/teaè /teach /g;
222 s/teèniques/techniques/g;
223 s/eènolog/echnolog/g;
224 s/traèomatis/trachomatis/g;
225 s/uæess/uccess/g;
226 s/Vaæines /Vaccines /g;
227 s/ whiè / which /g;
228 s/Wa¹ington/Washington/g;
229 s/Yamanouèi/Yamanouchi/g;
230 s/ynè/ynch/g;
231 s/Zinner ©./Zinner SH./g;
232 s/Zinner ©/Zinner SH/g;
233 s/Zuriè/Zurich/g;
234
235 # ovi idu uvijek na kraju
236 s/generich/generiè/g;
237 s/i¹hoðenje/ishoðenje/g;
238 s/Jurichu /Jurièu /g;
239 s/merichk/merièk/g;
240 s/Petrichi/Petrièi/g;
241 s/Petrichevi/Petrièevi/g;
242 s/prichuva/prièuva/g;
243 s/ra¹od/rashod/g;
244 s/Ra¹od/Rashod/g;
245 s/èosen/chosen/g;
246
247 s/iso\.è/iso\.ch/g;
248 s/medicorpteè\.com/medicorptech.com/g;
249 s/èlorination/chlorination/g;
250 s/Teènical/Technical/g;
251 s/Sati¹ Jo¹i/Satish Joshi/g;
252 s/èloride/chloride/g;
253 s/Fisèer/Fischer/g;
254 s/ èain/ chain/g;
255 s/Hydrièlorination/ Hydrichlorination/g;
256 s/Manniè/Mannich/g;
257 s/Flemi¹/Flemish/g;
258
259 s/AREA ©APE=/AREA SHAPE=/g;
260 s/&Ecirc;/æ/g; # hm?
261
262 s/Streptocoæus/Streptococcus/g;
263 s/Coæi/Cocci/g;
264 s/ÈPSG/CHPSG/g;
265
266 s/BENÈMARKING/BENCHMARKING/g;
267 s/Benèmarking/Benchmarking/g;
268 s/Fi¹er/Fisher/g;
269 s/¹eppard/sheppard/g;
270 s/Czeè/Czech/g;
271 s/To¹iba/Toshiba/g;
272 s/Marè/March/g;
273
274 s/Attach/Attach/g;
275 s/attachment/attachment/g;
276 s/show/show/g;
277
278 }

  ViewVC Help
Powered by ViewVC 1.1.26