
reemplazar={"<br><span class=i>","<span class=b>","<span class=i>","</span>","<li>"}


function peticion2()
	http.get("http://www.wordreference.com/definicion/"..palabra,"a.txt")

	a=io.open("a.txt","r+")
	txt=a:read("*a")
	a:close()
	if string.find(txt,"</h3><ol class='entry'>")!=nil then
		a,b=string.find(txt,"</h3><ol class='entry'>")
		if string.find(txt,'<br></ol></div>')!=nil then
			a=string.find(txt,'<br></ol></div>') 
		end
		txt=string.sub(txt,b+1,a-1)
		for i=1,#reemplazar do
			txt=string.gsub(txt,reemplazar[i],"")
		end
		txt=full_txt(txt,0.6,300)
	else
		os.message("No se ha podido encontrar esa palabra")
	end
	--files.remove("a.txt")
	txt=nil
end




function diccionario()
liberar(10)
txt=""
palabra="Buscar significado"

while true do
controls.read()
img_escritorio[fondo_escritorio]:blend(0,0,130)


screen.print(240,30,"Diccionario Espaņol",0.85,rojo,blanco,"center")
draw.rect(80,60,320,20,negro)
draw.rect(80,100,320,160,negro)


if col(p,stra[6]) then 
	if controls.press("cross") then 
		if keyboard==1 then
			palabra=teclado(1,"Escribe tu palabra",30,"")
		else
			palabra=os.osk("Escribe tu palabra","",30,1,0)
		end
		peticion2()
	end
end

screen.print(83,63,palabra,0.7,blanco,0)
screen.print(85,105,txt,0.7,blanco,rojo)

if controls.start() then txt=nil sistema() end
puntero()
screen.flip()
end
end



