Visit url: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m moved Visit url() to Visit url over redirect
imported>StDoodle
No edit summary
Line 1: Line 1:
'''[[string]]/[[buffer]] visit_url( [[string]] page_to_visit )'''
{{
<br />Returns the HTML of the page selected.
#vardefine:name|visit_url}}{{
#vardefine:return_type|buffer}}{{


For addresses inside of KoL, providing input on which server to access is not required; KoL Mafia will automatically retrieve the HTML source of the page you provide, for the server you are currently logged onto:
FunctionPage|
<pre>string messages_html = visit_url( "messages.php" );</pre>
name={{#var:name}}|
function_category=String Handling Routines|


function1={{Function|
name={{#var:name}}|
aggregate={{#var:aggregate}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
parameter1={{Param|string|page}}|
p1desc={{Pspan|page}} is the page to visit|
}}|


For pages located outside of KoL, the full address must be provided:
function_description=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 {{pspan|page}}, and KoLmafia will populate the rest of the url. However, pages outside of KoL require the full url to be supplied for {{pspan|page}}.|
<pre>string visit_info = visit_url( "http://wiki.kolmafia.us/index.php?title=Visit_url()" );</pre>


Will return <i><b>all</b></i> of the html. If you see just the words, it will return those, and also all the html code that surrounds it.
code1={{CodeSample|
{{Format}}
title=Code Samples|
description=Visits your private character sheet.|
code=
<syntaxhighlight>
visit_url( "charsheet.php" );
</syntaxhighlight>}}|
 
code2={{CodeSample|
description=Visits google.|
code=
<syntaxhighlight>
visit_url( "http://www.google.com/");
</syntaxhighlight>}}|
 
}}

Revision as of 17:25, 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/");