NationStates Jolt Archive


Anybody have a nation loggin script that I could borrow?

Qaaolchoura
05-08-2004, 17:31
As the title says, if anybody is willing to give me the code a nice auto-loggin script that won't mess up my entire desktop, I'd be greatful.

Peace, Truth, and Justice,
Luke
Spoffin
05-08-2004, 18:07
As the title says, if anybody is willing to give me the code a nice auto-loggin script that won't mess up my entire desktop, I'd be greatful.

Peace, Truth, and Justice,
Luke
To do all your puppets?
Qaaolchoura
05-08-2004, 19:41
Or, well most of them, yeah.
The ones that I really feel like holding onto anywhen.
Juxtapositions
05-08-2004, 21:54
I guess that depends. Can you do PHP?
Rapid Dr3am
09-08-2004, 00:39
I can do PHP, Can you give me a quick run down of what this script is supposed to do?
Rapid Dr3am
09-08-2004, 00:55
Sorry to double post.

Can I load a URL like http://www.somedomain.com/cgi-bin/login.cgi?nation=rapid_dr3am&pass=password&return=true

If so then I need a full url, and I'd do it like this:


<?php
$nation = 'rapid_dr3am'; // nation name
$password = 'password'; // nation password

$main = @file_get_contents ("http://www.nationstates.net/cgi-bin/index.cgi?nation=".$nation."&amp;password=".$password."&amp;logging_in=1");
echo $main;
?>


That's pretty simple, I need a full URL that accepts things like that, I know that a lot of PHP scripts support logins like that with $_GET but i'm not so sure with Perl.
Rapid Dr3am
09-08-2004, 01:02
Alright 3 posts in a row, but I've made it anyway.


<?php
$nation = 'rapid_dr3am'; // nation name
$password = 'password'; // nation password

$main = @file_get_contents ("http://www.nationstates.net/cgi-bin/index.cgi?nation=".$nation."&amp;password=".$password."&amp;logging_in=1");
echo $main;
echo ('<br /><br /><br /><a href="http://www.nationstates.net">NationStates</a> Login Script by <a href="http://www.antonybailey.net/">Antony Bailey</a>.');
?>


That should work perfectly
Rapid Dr3am
24-08-2004, 02:23
Does it actually work?
SalusaSecondus
24-08-2004, 02:50
Just a friendly reminder, when possible POST login information, don't GET it.
Rapid Dr3am
01-09-2004, 01:57
I wanted to refrain from things along the lines of a form, and i figured just using file_get_contents(); (http://www.php.net/file_get_contents) was my best bet.

I use that function to much, it's one of my favourites.
RSJ
26-11-2004, 01:36
How do I use this? I tried putting it in a .php file in a web server, but is said "No input file specified."
Aeruillin
31-03-2005, 15:36
Another question (sorry for reviving such an ancient thread): How do you send the information via POST rather than GET? I know that with GET you just append it to the url, but I have not yet heard of a way to send POST parameters with a php script.

Edit: Okay, GET url works. nation=NATION&password=PASSWORD returns a "logged in successfully" page. Now the problem is staying logged in. NS does it with a cookie, and apparently the server doesn't store that cookie. So the login will probably still be manual.

I wonder if the Bunny could help me here. ;)