📄 yahoo_profile.c
字号:
"職業:", "趣味:", "最近の出来事:", NULL,#if 0 "おすすめサイト",#else "自己PR", /* "Self description" comes before "Links" for yahoo.co.jp */#endif NULL, NULL, NULL, "おすすめサイト1:", "おすすめサイト2:", "おすすめサイト3:", NULL }, { KO, "ko", "EUC-KR", "야후! ID:", "비공개", "비공개", "My Email", "실명:", "거주지:", "나이:", "결혼 여부:", "성별:", "직업:", "취미:", "자기 소개:", "좋아하는 명언", "링크", "홈페이지를 지정하지 않았습니다.", "홈페이지:", "추천 사이트가 없습니다.", "추천 사이트 1:", "추천 사이트 2:", "추천 사이트 3:", NULL }, { NO, "no", "ISO-8859-1", "Yahoo! ID:", "Privat", "Ikke noe svar", "Min e-post", "Virkelig navn:", "Sted:", "Alder:", "Sivilstatus:", "Kjønn:", "Yrke:", "Hobbyer:", "Siste nytt:", "Yndlingssitat", "Lenker", "Ingen hjemmeside angitt", "Hjemmeside:", "No cool link specified", "Bra lenke 1:", "Bra lenke 2:", "Bra lenke 3:", NULL }, { PT, "pt", "ISO-8859-1", "ID Yahoo!:", "Particular", "Sem resposta", "Meu e-mail", "Nome verdadeiro:", "Local:", "Idade:", "Estado civil:", "Sexo:", "Ocupação:", "Hobbies:", "Últimas notícias:", "Frase favorita", "Links", "Nenhuma página pessoal especificada", "Página pessoal:", "Nenhum site legal especificado", "Site legal 1:", "Site legal 2:", "Site legal 3:", NULL }, { SV, "sv", "ISO-8859-1", "Yahoo!-ID:", "Privat", "Inget svar", "Min mail", "Riktigt namn:", "Plats:", "Ålder:", "Civilstånd:", "Kön:", "Yrke:", "Hobby:", "Senaste nytt:", "Favoritcitat", "Länkar", "Ingen hemsida specificerad", "Hemsida:", "Ingen cool länk specificerad", "Coola länkar 1:", "Coola länkar 2:", "Coola länkar 3:", NULL }, { ZH_CN, "zh_CN", "GB2312", "Yahoo! ID:", "没有提供", "没有回答", "个人电邮地址", "真实姓名:", "所在地点:", "年龄:", "婚姻状况:", "性别:", "职业:", "业余爱好:", "个人近况:", "喜欢的引言", "链接", "没有个人主页", "个人主页:", "没有推荐网站链接", "推荐网站链接 1:", "推荐网站链接 2:", "推荐网站链接 3:", NULL }, { ZH_HK, "zh_HK", "Big5", "Yahoo! ID:", "私人的", "沒有回答", "電子信箱", "真實姓名:", "地點:", "年齡:", "婚姻狀況:", "性別:", "職業:", "嗜好:", "最新消息:", "最喜愛的股票叫價", /* [sic] Yahoo!'s translators don't check context */ "連結", "沒有注明個人網頁", /* [sic] */ "個人網頁:", "沒有注明 Cool 連結", /* [sic] */ "Cool 連結 1:", /* TODO */ "Cool 連結 2:", /* TODO */ "Cool 連結 3:", /* TODO */ NULL }, { ZH_TW, "zh_TW", "Big5", "帳 號:", "沒有提供", "沒有回應", "電子信箱", "姓名:", "地點:", "年齡:", "婚姻狀態:", "性別:", "職業:", "興趣:", "個人近況:", "喜歡的名句", "連結", "沒有個人網頁", "個人網頁:", "沒有推薦網站連結", "推薦網站連結 1:", "推薦網站連結 2:", "推薦網站連結 3:", NULL }, { ZH_US, "zh_US", "Big5", /* ZH_US is like ZH_TW, but also a bit like ZH_HK */ "Yahoo! ID:", "沒有提供", "沒有回答", "個人Email地址", "真實姓名:", "地點:", "年齡:", "婚姻狀態:", "性別:", "職業:", "嗜好:", "個人近況:", "喜歡的名句", "連結", "沒有個人網頁", "個人網頁:", "沒有推薦網站連結", "推薦網站連結 1:", /* TODO */ "推薦網站連結 2:", /* TODO */ "推薦網站連結 3:", /* TODO */ NULL }, { XX, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL },};static char *yahoo_info_date_reformat(const char *field, size_t len){ char *tmp = g_strndup(field, len); time_t t = purple_str_to_time(tmp, FALSE, NULL, NULL, NULL); g_free(tmp); return g_strdup(purple_date_format_short(localtime(&t)));}static char *yahoo_remove_nonbreaking_spaces(char *str){ char *p; while ((p = strstr(str, " ")) != NULL) { *p = ' '; /* Turn 's into ordinary blanks */ p += 1; memmove(p, p + 5, strlen(p + 5)); str[strlen(str) - 5] = '\0'; } return str;}static void yahoo_extract_user_info_text(PurpleNotifyUserInfo *user_info, YahooGetInfoData *info_data) { PurpleBuddy *b; YahooFriend *f; b = purple_find_buddy(purple_connection_get_account(info_data->gc), info_data->name); if (b) { if(b->alias && b->alias[0]) { char *aliastext = g_markup_escape_text(b->alias, -1); purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext); g_free(aliastext); } #if 0 if (b->idle > 0) { char *idletime = purple_str_seconds_to_string(time(NULL) - b->idle); purple_notify_user_info_add_pair(user_info, _("Idle"), idletime); g_free(idletime); } #endif /* Add the normal tooltip pairs */ yahoo_tooltip_text(b, user_info, TRUE); if ((f = yahoo_friend_find(info_data->gc, b->name))) { const char *ip; if ((ip = yahoo_friend_get_ip(f))) purple_notify_user_info_add_pair(user_info, _("IP Address"), ip); } }}#if PHOTO_SUPPORTstatic char *yahoo_get_photo_url(const char *url_text, const char *name) { GString *s = g_string_sized_new(strlen(name) + 8); char *p; char *it = NULL; /*g_string_printf(s, " alt=\"%s\">", name);*/ /* Y! newformat */ g_string_printf(s, " alt=%s>", name); p = strstr(url_text, s->str); if (p) { /* Search backwards for "http://". This is stupid, but it works. */ for (; !it && p > url_text; p -= 1) { /*if (strncmp(p, "\"http://", 8) == 0) {*/ /* Y! newformat*/ if (strncmp(p, "=http://", 8) == 0) { char *q; p += 1; /* skip only the ' ' */ q = strchr(p, ' '); if (q) { it = g_strndup(p, q - p); } } } } g_string_free(s, TRUE); return it;}static voidyahoo_got_photo(PurpleUtilFetchUrlData *url_data, gpointer data, const gchar *url_text, size_t len, const gchar *error_message);#endif /* PHOTO_SUPPORT */static void yahoo_got_info(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, size_t len, const gchar *error_message){ YahooGetInfoData *info_data = (YahooGetInfoData *)user_data; PurpleNotifyUserInfo *user_info; char *p;#if PHOTO_SUPPORT YahooGetInfoStepTwoData *info2_data; char *photo_url_text = NULL;#else gboolean found = FALSE; char *stripped; int stripped_len; char *last_updated_utf8_string = NULL;#endif const char *last_updated_string = NULL; char *url_buffer; GString *s; char *tmp; char *profile_url_text = NULL; int lang, strid; struct yahoo_data *yd; const profile_strings_node_t *strings = NULL; const char *title; profile_state_t profile_state = PROFILE_STATE_DEFAULT; purple_debug_info("yahoo", "In yahoo_got_info\n"); yd = info_data->gc->proto_data; yd->url_datas = g_slist_remove(yd->url_datas, url_data); user_info = purple_notify_user_info_new(); title = yd->jp ? _("Yahoo! Japan Profile") : _("Yahoo! Profile"); /* Get the tooltip info string */ yahoo_extract_user_info_text(user_info, info_data); /* We failed to grab the profile URL. This is not expected to actually * happen except under unusual error conditions, as Yahoo is observed * to send back HTML, with a 200 status code. */ if (error_message != NULL || url_text == NULL || strcmp(url_text, "") == 0) { purple_notify_user_info_add_pair(user_info, _("Error retrieving profile"), NULL); purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); purple_notify_user_info_destroy(user_info); g_free(profile_url_text); g_free(info_data->name); g_free(info_data); return; } /* Construct the correct profile URL */ s = g_string_sized_new(80); /* wild guess */ g_string_printf(s, "%s%s", (yd->jp? YAHOOJP_PROFILE_URL: YAHOO_PROFILE_URL), info_data->name); profile_url_text = g_string_free(s, FALSE); s = NULL; /* We don't yet support the multiple link level of the warning page for * 'adult' profiles, not to mention the fact that yahoo wants you to be * logged in (on the website) to be able to view an 'adult' profile. For * now, just tell them that we can't help them, and provide a link to the * profile if they want to do the web browser thing. */ p = strstr(url_text, "Adult Profiles Warning Message"); if (!p) { p = strstr(url_text, "Adult Content Warning"); /* TITLE element */ } if (p) { tmp = g_strdup_printf("<b>%s</b><br><br>" "%s<br><a href=\"%s\">%s</a>", _("Sorry, profiles marked as containing adult content " "are not supported at this time."), _("If you wish to view this profile, " "you will need to visit this link in your web browser:"), profile_url_text, profile_url_text); purple_notify_user_info_add_pair(user_info, NULL, tmp); g_free(tmp); purple_notify_userinfo(info_data->gc, info_data->name, user_info, NULL, NULL); g_free(profile_url_text); purple_notify_user_info_destroy(user_info); g_free(info_data->name); g_free(info_data); return; } /* Check whether the profile is written in a supported language */ for (lang = 0;; lang += 1) { last_updated_string = profile_langs[lang].last_updated_string; if (!last_updated_string) break; p = strstr(url_text, last_updated_string); if (p) { if (profile_langs[lang].det && !strstr(url_text, profile_langs[lang].det)) p = NULL; else break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -