comparison src/protocols/msn/msn.c @ 6573:cc41123c684a

[gaim-migrate @ 7095] Bjoern Voigt writes: "As far as I can see, you commited a patch, which adds support for "Get User Info" on Yahoo and MSN. It's not my small Yahoo Get Info patch, it's the bigger one, which parses Yahoo and MSN profile pages. I prepared a patch for it, which adds i18n macros to this patch. Please commit the attached patch i18n21.patch. The patch works fine for Yahoo contacts with English language preference. Unfortunately the patch doesn't work with contacts with other language preferences. The problem is, that in Yahoo every user can set up a language for his/her profile. So http://profiles.yahoo.com/CONTACT can deliver English, German, French, ... pages, depending on CONTACT's preference. The yahoo_get_info() functions doesn't handle this and it's not easy to handle this. I have some ideas, how to fix this issue. I like to discuss this with the author of the patch or in gaim-devel." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 22 Aug 2003 20:06:18 +0000
parents e34907332e46
children a4622f1fb5a1
comparison
equal deleted inserted replaced
6572:4f097c1069b0 6573:cc41123c684a
1165 char buf[1024]; 1165 char buf[1024];
1166 char *user_url = NULL; 1166 char *user_url = NULL;
1167 1167
1168 if (!url_text || !strcmp(url_text,"")) { 1168 if (!url_text || !strcmp(url_text,"")) {
1169 g_show_info_text(NULL, NULL, 2, 1169 g_show_info_text(NULL, NULL, 2,
1170 "<html><body><b>Error retrieving profile</b></body></html>", NULL); 1170 _("<html><body><b>Error retrieving profile</b></body></html>"), NULL);
1171 return; 1171 return;
1172 } 1172 }
1173 1173
1174 /* if they have a homepage link, MSN masks it such that we need to 1174 /* if they have a homepage link, MSN masks it such that we need to
1175 * fetch the url out before strip_html() nukes it */ 1175 * fetch the url out before strip_html() nukes it */
1209 /* gonna re-use the memory we've already got for url_text */ 1209 /* gonna re-use the memory we've already got for url_text */
1210 strcpy(url_text, "<html><body>\n"); 1210 strcpy(url_text, "<html><body>\n");
1211 1211
1212 /* extract their Name and put it in */ 1212 /* extract their Name and put it in */
1213 info_extract_field(stripped, url_text, "\tName", 0, "\t", '\n', 1213 info_extract_field(stripped, url_text, "\tName", 0, "\t", '\n',
1214 "Undisclosed", "Name", 0, NULL); 1214 _("Undisclosed"), _("Name"), 0, NULL);
1215 1215
1216 /* extract their Age and put it in */ 1216 /* extract their Age and put it in */
1217 info_extract_field(stripped, url_text, "\tAge", 0, "\t", '\n', 1217 info_extract_field(stripped, url_text, "\tAge", 0, "\t", '\n',
1218 "Undisclosed", "Age", 0, NULL); 1218 _("Undisclosed"), _("Age"), 0, NULL);
1219 1219
1220 /* extract their Gender and put it in */ 1220 /* extract their Gender and put it in */
1221 info_extract_field(stripped, url_text, "\tGender", 6, "\t", '\n', 1221 info_extract_field(stripped, url_text, "\tGender", 6, "\t", '\n',
1222 "Undisclosed", "Gender", 0, NULL); 1222 _("Undisclosed"), _("Gender"), 0, NULL);
1223 1223
1224 /* extract their MaritalStatus and put it in */ 1224 /* extract their MaritalStatus and put it in */
1225 info_extract_field(stripped, url_text, "\tMaritalStatus", 0, "\t", '\n', 1225 info_extract_field(stripped, url_text, "\tMaritalStatus", 0, "\t", '\n',
1226 "Undisclosed", "Marital Status", 0, NULL); 1226 _("Undisclosed"), _("Marital Status"), 0, NULL);
1227 1227
1228 /* extract their Location and put it in */ 1228 /* extract their Location and put it in */
1229 info_extract_field(stripped, url_text, "\tLocation", 0, "\t", '\n', 1229 info_extract_field(stripped, url_text, "\tLocation", 0, "\t", '\n',
1230 "Undisclosed", "Location", 0, NULL); 1230 _("Undisclosed"), _("Location"), 0, NULL);
1231 1231
1232 /* extract their Occupation and put it in */ 1232 /* extract their Occupation and put it in */
1233 info_extract_field(stripped, url_text, "\t Occupation", 6, "\t", '\n', 1233 info_extract_field(stripped, url_text, "\t Occupation", 6, "\t", '\n',
1234 "Undisclosed", "Occupation", 0, NULL); 1234 _("Undisclosed"), _("Occupation"), 0, NULL);
1235 1235
1236 /* the fields, 'A Little About Me', 'Favorite Things', 'Hobbies and Interests', 1236 /* the fields, 'A Little About Me', 'Favorite Things', 'Hobbies and Interests',
1237 * 'Favorite Quote', and 'My Homepage' may or may not appear, in any combination. 1237 * 'Favorite Quote', and 'My Homepage' may or may not appear, in any combination.
1238 * however, they do appear in certain order, so we can successively search to 1238 * however, they do appear in certain order, so we can successively search to
1239 * pin down the distinct values. 1239 * pin down the distinct values.
1240 */ 1240 */
1241 1241
1242 /* check if they have A Little About Me */ 1242 /* check if they have A Little About Me */
1243 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Favorite Things", '\n', 1243 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Favorite Things", '\n',
1244 NULL, "A Little About Me", 0, NULL)) 1244 NULL, _("A Little About Me"), 0, NULL))
1245 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Hobbies and Interests", '\n', 1245 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Hobbies and Interests", '\n',
1246 NULL, "A Little About Me", 0, NULL)) 1246 NULL, _("A Little About Me"), 0, NULL))
1247 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Favorite Quote", '\n', 1247 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "Favorite Quote", '\n',
1248 NULL, "A Little About Me", 0, NULL)) 1248 NULL, _("A Little About Me"), 0, NULL))
1249 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "My Homepage\tTake a look", '\n', 1249 if(!info_extract_field(stripped, url_text, "\tA Little About Me", 1, "My Homepage\tTake a look", '\n',
1250 NULL, "A Little About Me", 0, NULL)) 1250 NULL, _("A Little About Me"), 0, NULL))
1251 info_extract_field(stripped, url_text, "\tA Little About Me", 1, "last updated", '\n', 1251 info_extract_field(stripped, url_text, "\tA Little About Me", 1, "last updated", '\n',
1252 NULL, "A Little About Me", 0, NULL); 1252 NULL, _("A Little About Me"), 0, NULL);
1253 1253
1254 /* check if they have Favorite Things */ 1254 /* check if they have Favorite Things */
1255 if(!info_extract_field(stripped, url_text, "Favorite Things", 1, "Hobbies and Interests", '\n', 1255 if(!info_extract_field(stripped, url_text, "Favorite Things", 1, "Hobbies and Interests", '\n',
1256 NULL, "Favorite Things", 0, NULL)) 1256 NULL, _("Favorite Things"), 0, NULL))
1257 if(!info_extract_field(stripped, url_text, "Favorite Things", 1, "Favorite Quote", '\n', 1257 if(!info_extract_field(stripped, url_text, "Favorite Things", 1, "Favorite Quote", '\n',
1258 NULL, "Favorite Things", 0, NULL)) 1258 NULL, "Favorite Things", 0, NULL))
1259 if(info_extract_field(stripped, url_text, "Favorite Things", 1, "My Homepage\tTake a look", '\n', 1259 if(info_extract_field(stripped, url_text, "Favorite Things", 1, "My Homepage\tTake a look", '\n',
1260 NULL, "Favorite Things", 0, NULL)) 1260 NULL, _("Favorite Things"), 0, NULL))
1261 info_extract_field(stripped, url_text, "Favorite Things", 1, "last updated", '\n', 1261 info_extract_field(stripped, url_text, "Favorite Things", 1, "last updated", '\n',
1262 NULL, "Favorite Things", 0, NULL); 1262 NULL, _("Favorite Things"), 0, NULL);
1263 1263
1264 /* check if they have Hobbies and Interests */ 1264 /* check if they have Hobbies and Interests */
1265 if(!info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "Favorite Quote", '\n', 1265 if(!info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "Favorite Quote", '\n',
1266 NULL, "Hobbies and Interests", 0, NULL)) 1266 NULL, _("Hobbies and Interests"), 0, NULL))
1267 if(info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "My Homepage\tTake a look", '\n', 1267 if(info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "My Homepage\tTake a look", '\n',
1268 NULL, "Hobbies and Interests", 0, NULL)) 1268 NULL, _("Hobbies and Interests"), 0, NULL))
1269 info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "last updated", '\n', 1269 info_extract_field(stripped, url_text, "Hobbies and Interests", 1, "last updated", '\n',
1270 NULL, "Hobbies and Interests", 0, NULL); 1270 NULL, _("Hobbies and Interests"), 0, NULL);
1271 1271
1272 /* check if they have Favorite Quote */ 1272 /* check if they have Favorite Quote */
1273 if(!info_extract_field(stripped, url_text, "Favorite Quote", 1, "My Homepage\tTake a look", '\n', 1273 if(!info_extract_field(stripped, url_text, "Favorite Quote", 1, "My Homepage\tTake a look", '\n',
1274 NULL, "Favorite Quote", 0, NULL)) 1274 NULL, _("Favorite Quote"), 0, NULL))
1275 info_extract_field(stripped, url_text, "Favorite Quote", 1, "last updated", '\n', 1275 info_extract_field(stripped, url_text, "Favorite Quote", 1, "last updated", '\n',
1276 NULL, "Favorite Quote", 0, NULL); 1276 NULL, _("Favorite Quote"), 0, NULL);
1277 1277
1278 /* extract the last updated date and put it in */ 1278 /* extract the last updated date and put it in */
1279 info_extract_field(stripped, url_text, "\tlast updated:", 1, "\n", '\n', 1279 info_extract_field(stripped, url_text, "\tlast updated:", 1, "\n", '\n',
1280 NULL, "Last Updated", 0, NULL); 1280 NULL, _("Last Updated"), 0, NULL);
1281 1281
1282 /* if we were able to fetch a homepage url earlier, stick it in there */ 1282 /* if we were able to fetch a homepage url earlier, stick it in there */
1283 if(user_url) 1283 if(user_url)
1284 { 1284 {
1285 g_snprintf(buf,sizeof(buf),"<b>Home Page:</b><br><a href=\"%s\">%s</a><br>\n",user_url,user_url); 1285 g_snprintf(buf,sizeof(buf),"<b>%s:</b><br><a href=\"%s\">%s</a><br>\n",_("Home Page"),user_url,user_url);
1286 strcat(url_text,buf); 1286 strcat(url_text,buf);
1287 } 1287 }
1288 1288
1289 /* finish it off, and show it to them */ 1289 /* finish it off, and show it to them */
1290 strcat(url_text, "</body></html>\n"); 1290 strcat(url_text, "</body></html>\n");