| View previous topic :: View next topic |
| Author |
Message |
Fr3aK Voice
Joined: 11 Apr 2013 Posts: 4
|
Posted: Thu Apr 11, 2013 12:14 pm Post subject: fetch from api |
|
|
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. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Apr 12, 2013 1:36 am Post subject: |
|
|
You need to use the http package for this.
Here's an example:
| Code: |
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. |
|
| Back to top |
|
 |
|