/[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.1 - (show annotations)
Fri Apr 14 06:01:44 2000 UTC (22 years, 7 months ago) by dpavlin
Branch: MAIN
Branch point for: PLIVA
File MIME type: text/plain
Initial revision

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

  ViewVC Help
Powered by ViewVC 1.1.26