Difference between revisions of "Visit url"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
imported>StDoodle
m
Line 33: Line 33:
 
</syntaxhighlight>}}|
 
</syntaxhighlight>}}|
  
 +
special=Note that this function returns void if the page does not exist or if the request times-out.
 
}}
 
}}
 +
{{RFI|Is the special note correct? It appears to sometimes return an empty string & sometimes void; I'm unclear on how the two interact}}

Revision as of 17:29, 9 March 2010

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