JSON→DrawText

不具合続出。
型が原因かなあ。

不具合続出。
型が原因かなあ。

  • タグ:
  • タグはありません
	#include "user32.as"
	#include "hspinet.as"
	#include "mod_regexp.as"
	font "Meiryo",13
	
	;buf=0x3042,0x3044,0x3046,0x3048,0x304a,0x304b,0x304d,0x304f,0x3051,0x3053
	
	netinit
	neturl "http://api.twitter.com/1/statuses/show/"
	
	netrequest_get "219126197236408321.json"
	
	repeat
	netexec res
	if res : break
	await 50
	loop
	
	netgetv buf
	
	jsonopen pointer,buf
	jsonnkf "Ws"
	
	jsongets text,"text",pointer
	jsonout text2,pointer
	
	jsonclose
	
	//JSON→平文変換
	mes text
	
	//JSONから\u****形式を取り出す
	split buf,"\"text\":\"",a,b
	split b,"\"",textjson,c
	
	mes "------------------------------------------------------"
	mes textjson
	mes "------------------------------------------------------"
	
	
	val = replace(""+textjson,"^\\\\u","0x")
	val = replace(""+val,"\\\\u",",0x")
	
	objsize 550,30
	input val
	
	val=0x3042,0x3044,0x3046,0x3048,0x304a,0x304b,0x304d,0x304f,0x3051,0x3053
	
	//JSON→DrawTextWで描画(?)
	rc=0,150,400,300
	DrawTextW hdc,varptr(val),-1,varptr(rc),0
	redraw 1