Changeset 429a9b1
- Timestamp:
- 2011-08-26T20:16:17Z (13 years ago)
- Branches:
- master
- Children:
- 0fff0b2
- Parents:
- 2322a9f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
r2322a9f r429a9b1 499 499 txs->text = g_strdup_printf("RT @%s: %s", rtxs->user->screen_name, rtxs->text); 500 500 txs_free(rtxs); 501 } else { 502 struct xt_node *urls, *url; 503 504 urls = xt_find_path(node, "entities/urls"); 505 for (url = urls ? urls->children : NULL; url; url = url->next) { 506 /* "short" is a reserved word. :-P */ 507 struct xt_node *kort = xt_find_node(url->children, "url"); 508 struct xt_node *disp = xt_find_node(url->children, "display_url"); 509 char *pos, *new; 510 511 if (!kort || !kort->text || !disp || !disp->text || 512 !(pos = strstr(txs->text, kort->text))) 513 continue; 514 515 *pos = '\0'; 516 new = g_strdup_printf("%s%s <%s>%s", txs->text, kort->text, 517 disp->text, pos + strlen(kort->text)); 518 519 g_free(txs->text); 520 txs->text = new; 521 } 501 522 } 502 523 … … 788 809 td->flags &= ~TWITTER_GOT_TIMELINE; 789 810 790 char *args[ 4];811 char *args[6]; 791 812 args[0] = "cursor"; 792 813 args[1] = g_strdup_printf("%lld", (long long) next_cursor); 814 args[2] = "include_entities"; 815 args[3] = "true"; 793 816 if (td->timeline_id) { 794 args[ 2] = "since_id";795 args[ 3] = g_strdup_printf("%llu", (long long unsigned int) td->timeline_id);817 args[4] = "since_id"; 818 args[5] = g_strdup_printf("%llu", (long long unsigned int) td->timeline_id); 796 819 } 797 820 798 821 twitter_http(ic, TWITTER_HOME_TIMELINE_URL, twitter_http_get_home_timeline, ic, 0, args, 799 td->timeline_id ? 4 : 2);822 td->timeline_id ? 6 : 4); 800 823 801 824 g_free(args[1]); 802 825 if (td->timeline_id) { 803 g_free(args[ 3]);826 g_free(args[5]); 804 827 } 805 828 } … … 815 838 td->flags &= ~TWITTER_GOT_MENTIONS; 816 839 817 char *args[ 4];840 char *args[6]; 818 841 args[0] = "cursor"; 819 842 args[1] = g_strdup_printf("%lld", (long long) next_cursor); 843 args[2] = "include_entities"; 844 args[3] = "true"; 820 845 if (td->timeline_id) { 821 args[ 2] = "since_id";822 args[ 3] = g_strdup_printf("%llu", (long long unsigned int) td->timeline_id);846 args[4] = "since_id"; 847 args[5] = g_strdup_printf("%llu", (long long unsigned int) td->timeline_id); 823 848 } 824 849 825 850 twitter_http(ic, TWITTER_MENTIONS_URL, twitter_http_get_mentions, ic, 0, args, 826 td->timeline_id ? 4 : 2);851 td->timeline_id ? 6 : 4); 827 852 828 853 g_free(args[1]); 829 854 if (td->timeline_id) { 830 g_free(args[ 3]);855 g_free(args[5]); 831 856 } 832 857 }
Note: See TracChangeset
for help on using the changeset viewer.