3 # This script downloads list of Sony-Ericsson phones from web and
4 # prepares list suitable for common/gsmphones.c
6 URL
=http
://homepage.mac.com
/alvinmok
/ericsson
/types.html
9 wget
-O - "$URL" |
tr '\r' '\n' > "$tmp"
12 /Type code orderin/ { p = 1; }
13 /<tr><th>.*<\/th><td>.*<\/td>(<\/tr>)?/ { if (p) print $0; }
14 /<\/table>/ { p = 0;}' < "$tmp" | \
15 sed 's@</td></tr><tr><th>@\n@; s@<tr><th>@@; s@</th><td>@;@g; s@</td></tr>@@; s@</td>@@; s@<!-- @@; s@ -->@@;' | \
16 grep -Ev ' |Cancelled' | \
22 if (match($2, "(.*)/(.*)/(.*)", a)) {
27 if (match($2, "(.*)/(.*)", a)) {
31 if (match($1, "(.*)-([^-]*)/(.*)", a)) {
32 models[0] = a[1]"-"a[2];
33 models[1] = a[1]"-"a[3];
36 if (length(models[0]) == 14) {
37 sms = ", F_SUBMIT_SIM_ONLY";
41 if (models[0] == "FAE-1021011-BV") {
42 sms = sms", F_SMS_LOCATION_0";
44 if (length(models) == 2 && length(ids) == 2) {
45 print "\t{\""ids[0]"\",\t\""models[0]"\" ,\"\",\t\t\t\t {F_OBEX"sms", 0}},";
46 print "\t{\""ids[1]"\",\t\""models[1]"\" ,\"\",\t\t\t\t {F_OBEX"sms", 0}},";
48 /* Restore IDs, we need to have unique model */
49 if (length(models) == 1) {
53 for (model in models) {
55 print "\t{\""ids[id]"\",\t\""models[model]"\" ,\"\",\t\t\t\t {F_OBEX"sms", 0}},";