egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fetch from api

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Fr3aK
Voice


Joined: 11 Apr 2013
Posts: 4

PostPosted: Thu Apr 11, 2013 12:14 pm    Post subject: fetch from api Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Apr 12, 2013 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber