Changeset 273 for trunk/DashboardTwitter
- Timestamp:
- 08/24/07 02:30:50 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/DashboardTwitter/plugins/DashboardTwitter/DashboardTwitter.pl
r271 r273 43 43 </mt:setvarblock> 44 44 <div id="recent-panel" class="<mt:unless name="tab" eq="recent">hidden</mt:unless>" mt:tab-content="recent"> 45 <mt:if name="data"> 45 46 <mt:loop name="data"> 46 47 <ul> … … 48 49 </ul> 49 50 </mt:loop> 51 <mt:else> 52 <mt:if name="error"><mt:var name="error"></mt:if> 53 </mt:if> 50 54 </div> 51 55 <div id="twit-panel" class="<mt:unless name="tab" eq="twit">hidden</mt:unless>" mt:tab-content="twit"> … … 123 127 my $res = $ua->request($req); 124 128 return unless $res->is_success(); 129 if ( my $prev = $res->previous) { 130 if ( ('302' eq $prev->code ) && ( $prev->location =~ m|http://static\.twitter\.com| ) ) { 131 $param->{error} = 'Twitter must be in maintenance'; 132 } 133 else { 134 $param->{error} = 'hmm?'; 135 } 136 } else { 137 my $s = $res->content; 138 $s =~ s/\\u([0-9a-fA-F]+)/&#x$1;/g; 139 eval { 140 my $recent = JSON::jsonToObj($s); 141 $param->{data} = $recent; 142 }; 143 if ($@) { 144 die $@ ; 145 } 146 } 125 147 126 my $s = $res->content;127 $s =~ s/\\u([0-9a-fA-F]+)/&#x$1;/g;128 eval {129 my $recent = JSON::jsonToObj($s);130 $param->{data} = $recent;131 };132 if ($@) {133 die $@ ;134 }135 136 148 1; 137 149 }
