Skip to content

Commit c7ae886

Browse files
committed
Update hitokoto link
1 parent 0b66bec commit c7ae886

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CCGameFramework/script/scene/web/hitokoto.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)