File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
CCGameFramework/script/scene/web Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -141,14 +141,16 @@ function M:init_event()
141141 if id == 5 then
142142 Web .get (' http://www.bing.com/HPImageArchive.aspx?format=js&n=1&idx=' .. this .bgidx , 101 )
143143 elseif id == 2 then
144- Web .get (' http://api.hitokoto.us/rand?cat=a&length=30' , 100 )
144+ -- Web.get('http://api.hitokoto.us/rand?cat=a&length=30', 100)
145+ Web .get (' http://api.hitokoto.cn/?c=a&length=30&encode=json' , 100 )
145146 end
146147 end
147148 self .handler [self .win_event .httpget ] = function (this , id , code , text )
148149 if id == 100 then
149150 local obj = JSON .decode (text , 1 , nil )
150151 if obj ~= nil then
151- local disp = obj .hitokoto .. ' \n !!〆' .. obj .source .. ' 〇'
152+ -- local disp = obj.hitokoto .. ' \n !!〆' .. obj.source .. '〇'
153+ local disp = ' 〆' .. obj .from .. ' 〇\n\n ' .. obj .hitokoto
152154 this .layers .text .text = disp
153155 this .layers .text :update_and_paint ()
154156 end
You can’t perform that action at this time.
0 commit comments