You are not logged in.
- Topics: Active | Unanswered
Pages: 1
#1 2010-01-29 11:53 am
- njh
- Member
- Registered: 2010-01-22
- Posts: 1
Could not validate API key
When I try to add entries I get the message back 'Could not validate API key'. This is a new key and I did a cut 'n' paste so I know it's right. There is no space either side, as mentioned in the only other support issue raised here about it.
Here is my code snippet, written in Perl - any clues?
....
my $ua = LWP::UserAgent->new();
$ua->timeout(60);
$ua->proxy('http', $proxy);
....
$ua->from($row[1]);
$ua->agent($url ? $url : $hostname);
my $res = $ua->request(HTTP::Request->new(GET =>
'http://www.stopforumspam.com/api?email=' . $row[1]));
if($res->is_success) {
....
unless($found) {
my $post = "http://www.stopforumspam.com/post.php?username=$row[0]&ip_addr=$ip&email=$row[1]&api_key=XXXX";
print "Posting $post to www.stopforumspam.com\n";
my $res = $ua->request(HTTP::Request->new(POST => $post));
unless($res->is_success) {
my $error_code = $res->code;
warn "$error_code: Failed to post to stopforumspam.com:\n";
print $res->as_string . "\n";
}
}
Offline
#2 2010-04-04 6:32 pm
- andypatmore
- Member
- From: Suffolk, UK
- Registered: 2008-08-24
- Posts: 18
- Website
Re: Could not validate API key
I know you may have forgotten about this post but care to compare notes? A couple of years ago I wrote a Perl Module that interfaced with the SFS API. It never made it onto the list of interfaces but I have recently been playing with this module again and have successfully added spammers to the database with it!
Andy
SFS Perl Module - Access the SFS API in you Perl Scripts
WebAPP CMS - A Wonderful CMS/Forum written in Perl
DreamHost - The Web Hosting Company I would recommend
Offline
#3 2011-02-27 10:37 am
- mid-devonian
- Member
- Registered: 2011-01-21
- Posts: 4
Re: Could not validate API key
I am having the same problem. My API key works fine through the 'add' form but cannot be validated when I automate the process using this php snippet:
if($spam) {
echo(
"<body onload=\"document.addspam_form.submit()\">
<form name=\"addspam_form\"
action=\"http://stopforumspam.com/add.php?username='$uname'&ip_addr=$ipaddr&email=$uemail&api_key=XXXX\"
method=\"post\"></form>");
}
I can see that the correct data is being submitted in the URI when I get the 'Could not validate the API key' message by looking at the address bar:
There are no spaces on either side of the API key parameter.
My host php server doesn't support sockets, so I couldn't use the alternative method in the API.
Any help would be appreciated.
Offline
#4 2011-02-27 11:11 am
- pedigree
- uıɐbɐ ʎɐqǝ ɯoɹɟ pɹɐoqʎǝʞ ɐ buıʎnq ɹǝʌǝu ɯ,ı
- From: Londonderry
- Registered: 2008-04-16
- Posts: 4,445
Re: Could not validate API key
change method from post to get, try that.
Offline
#5 2011-02-27 11:57 am
- mid-devonian
- Member
- Registered: 2011-01-21
- Posts: 4
Re: Could not validate API key
Thanks for that tip.
I was just going to post a message saying that I've cracked it and it's working for me now - I've seen the entry that I was trying to post has been accepted at your end.
What I did was to change the form to use <input type="hidden" name="username" value="$uname">, etc., for each item instead of passing them as parameters to the action (while still using method="post").
When I tested it locally using $_GET["api_key"], etc., at the localhost server end it worked for me either way (i.e passing values as parameters or using 'hidden' input fields). I guess there must be some subtle difference in your server processing.
Offline
#6 2011-02-27 12:13 pm
- mid-devonian
- Member
- Registered: 2011-01-21
- Posts: 4
Re: Could not validate API key
I just had a nasty thought - I've pinned my own IP address to the spammer by resubmitting the details from home!!
I keep a file of the bad guys who now get past reCaptcha, so I can show you the original attempt:
sadsadjouse: SeetlyTuptuby@europe2east.info 188.143.232.34 Sun 27 Feb 2011 13:12:56 +0000
whereas I've given you:
2011-02-27 11:32:07 86.154.178.221 sadsadjouse SeetlyTuptuby@europe2east.info
which is my IP address (via BT broadband).
I don't know if you have a tool to amend your database entries to get me out of this one?
Offline
#7 2011-02-27 12:19 pm
- mid-devonian
- Member
- Registered: 2011-01-21
- Posts: 4
Re: Could not validate API key
Ah - I just found a reference to the 'My Spammers' page and I have removed the offending (to me!) entry.
Offline
Pages: 1




