Call external URLs?

muffins

Member
This is almost more of a mafia question itself, but I'd like to replace my log files with an SQL database. I've already got the PHP file written to grab the variables from the URL and insert them into the database along with the current date, but I can't call it through my script. Here's the test code, simply with the domain name replaced with localhost.

Code:
int PeakStartingMeat;
int PeakStartingAdv;
string peakfilename;

void PeakInitializeVars()
{
PeakStartingMeat = my_meat();
PeakStartingAdv = my_adventures();
}

void main()
{
PeakInitializeVars();
cli_execute("[url]http://localhost/koltest.php?charname="[/url] + my_name() + "&start_adv=" + int_to_string(PeakStartingAdv) + "&start_meat=" + int_to_string(PeakStartingMeat) + "&end_meat=" + int_to_string(my_meat()) + "&submit=submit");
}

I've run it, the script said it succeeded, but the data was not entered. I know it's not the PHP file causing the problem... but I also now know that mafia doesn't seem to want to call external URLs... at least not from a script.

Is there any way I can actually accomlish this? I think it'd be great as a data mining tool for many other things as well!
 

holatuwol

Developer
KoLmafia v7.2+ allows for external URLs (it's how it manages to retrieve the simulator code from Ayvuir's website); however, it submits everything as a post request rather than as a get request. So, the problem I see off-hand is that you're looking at the wrong set of global variables in your .php file?
 

muffins

Member
Hmm, I have it set as GET because I tried it as POST and it didn't seem to want to work properly then, either :\

I may have just messed something up then, though, heh. I will test it again.
 
Top