This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

fetch from api

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
Fr3aK
Voice
Posts: 4
Joined: Thu Apr 11, 2013 12:09 pm

fetch from api

Post by Fr3aK »

Hello,
I am searching for a script which perform search in api, then shows the result when user types a command. Can you help me? I will be very thankful and for tut.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You need to use the http package for this.

Here's an example:

Code: Select all

package require http

set url "http://www.mypage.com/api/whatever"
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
and then use $content variable to do whatever you want with it.
Once the game is over, the king and the pawn go back in the same box.
Post Reply