Visit url

From Kolmafia
Revision as of 19:21, 9 March 2010 by imported>StDoodle
Jump to navigation Jump to search
needs(better_code_samples);

Function Syntax

buffer visit_url(string page )

  • page is the page to visit

Returns the HTML from the visited page (not just what is displayed when visiting the page, but all markup). Note that for addresses inside of KoL, it is only necessary to supply the page name for page, and KoLmafia will populate the rest of the url. However, pages outside of KoL require the full url to be supplied for page.

Code Samples

Visits your private character sheet.

visit_url( "charsheet.php" );

Visits google.

visit_url( "http://www.google.com/");

Special

Note that this function returns void if the page does not exist or if the request times-out.


Attention KoLmafia Experts!

We need your help; some details of this function's operation are unknown or unclear.

The following specific question has been raised:

  • Is the special note correct? It appears to sometimes return an empty string & sometimes void; I'm unclear on how the two interact