Sub punycodeEncode(text As String) As ResumableSub
Dim url As String = "https://www.punycoder.com/ajax-calls/punycoder/"
Dim ok As HttpJob
Dim data As String = $"submitButton=encode&Decoded=${text}"$
ok.Initialize("ok",Me)
ok.PostString(url,data)
ok.GetRequest.SetHeader("Referer", "https://www.punycoder.com/")
Wait For Jobdone (ok As HttpJob)
If ok.Success Then
Dim res As String
res = ok.GetString
'-----------------process result-------------------
Dim parser As MiniHtmlParser
parser.Initialize
Dim root As HtmlNode = parser.Parse(res)
Dim encoded_id As HtmlNode = parser.FindNode(root,"textarea",parser.CreateHtmlAttribute("id","Encoded"))
Dim result As String = parser.GetTextFromNode(encoded_id,0)
End If
ok.Release
Return result
End Sub