FAQ FAQ   Search Search   Memberlist Memberlist   Usergroups Usergroups   Register Register 
PhpBB- & WordPress- antispam.com
Home of the Antispam for all fields mod ! 
  Profile Profile   Log in to check your private messages Log in to check your private messages  Log inLog in 

 PhpBB- & WordPress- antispam.com Forum Index » [PhpBB2] Feature requests » External API for blogs/forms/etc.
  The time now is Sun Jun 25, 2017 4:46 am 

 Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
PostPosted: Wed Jan 10, 2007 12:09 am    Post subject: External API for blogs/forms/etc.  Reply with quote  

Lord Raiden
Experienced user


Joined: 11 Dec 2006
Posts: 123

I was thinking about something tonight and thought I'd throw it your way and see what you thought. Since this mod is so hugely useful and practical for quite a few applications, I thought it would be good idea to add an API for use with other applications. There are some of us, actually there's probubly a lot of us, here who have their blogs, CMS or other frontend stuff tied into their forums. In most cases this data is logged straight to the database and doesn't get spam filtered. So I was wondering if it would be possible to throw a small API together that could allow us to tie the spam mod into one of our front end commenting systems for like a blog or our CMS's or other things.

For example, in our code we'd put one line. Probubly something like this:

require("spam_api.php");

Inside of "spam_api.php" you'd have four basic fields that call the different elements of the spam filter. So this way we'd only need to call the API, insert 3 or 4 variables (probubly something like $email, $txt, $subject and $url) in our original script for the spam_api.php file to pick up, and then the spam_api.php file would call the rest of the elements of the anti-spam mod as needed to check for spam. And all this could be done without touching or calling phpbb first. The antispam api could then report back on the spam status of each of the four fields. From there each person would decide what should be done with the data that's flagged as potential spam.

Would something like that eventually be possible, or am I asking too much from you? ^_^;;

TOP View user's profileSend private message  BOTTOM
PostPosted: Wed Jan 10, 2007 12:13 am    Post subject:  Reply with quote  

A.I. BOT
Phpbb coder


Joined: 11 Dec 2006
Posts: 9
Location: Newfoundland, Canada

I would be interested in this as well for my MOD Smile

TOP View user's profileSend private messageSend e-mailVisit poster's websiteMSN Messenger  BOTTOM
PostPosted: Wed Jan 10, 2007 12:57 am    Post subject:  Reply with quote  

ramon fincken
Site Admin


Joined: 11 Dec 2006
Posts: 269
Location: A'dam/Diemen, The Netherlands

interesting...

we have an api right now in the contrib dir:
Code:
This API is for advanced users only, if you have never created a 'mod' scip this part ..


It's fairly easy: if you have a field or var. you want to check just do this:
Code:
   validate_spam($varname_over_here,'word');


And the function will take care of the rest!
Do NOT sent in array's ! Just full string/ints variables !

_________________
Phpbbantispam founder, available for freelance WordPress coding.

PhpBB2 mod: http://www.phpbbantispam.com/viewtopic.php?t=1
WordPress plugin: http://wordpress.org/extend/plugins/antispam-for-all-fields/
Project files & mailinglist: https://sourceforge.net/projects/phpbbantispam/

TOP View user's profileSend private messageVisit poster's website  BOTTOM
PostPosted: Fri Jan 12, 2007 9:15 pm    Post subject:  Reply with quote  

Lord Raiden
Experienced user


Joined: 11 Dec 2006
Posts: 123

Thanks! hehe. And yes, arrays would be bad. Wink

EDIT: Ok, I'm not finding what I want with this API. I am needing to know a couple things from this.

1. The way my script works, it needs a pass or fail code to continue to the next part. So what variable does the "validate_spam" script return that says pass or fail? My script can handle the rest from there. I just need to find out the spamyness of the submission.

2. What is the first script I need to call to make "validate_spam" work? Do I call the "includes/functions_antispam.php" file? Or is it another?

3. Does the "validate_spam" function trap the submission if it's found to be spammy, or just a pass/fail criteria? I'd prefer to let my script handle the rest once it's found to be either.

TOP View user's profileSend private message  BOTTOM
PostPosted: Sat Jun 16, 2007 4:18 pm    Post subject:  Reply with quote  

ramon fincken
Site Admin


Joined: 11 Dec 2006
Posts: 269
Location: A'dam/Diemen, The Netherlands

validate_spam will do EITHER
* nothing ( legit post OR .. a user in the usergroup OR .. a user with enough posts )

OR

* halt all actions, sends mail to site admin and store the message in the database


does that answer your question?
_________________
Phpbbantispam founder, available for freelance WordPress coding.

PhpBB2 mod: http://www.phpbbantispam.com/viewtopic.php?t=1
WordPress plugin: http://wordpress.org/extend/plugins/antispam-for-all-fields/
Project files & mailinglist: https://sourceforge.net/projects/phpbbantispam/

TOP View user's profileSend private messageVisit poster's website  BOTTOM
PostPosted: Tue Jul 03, 2007 2:36 am    Post subject:  Reply with quote  

ramon fincken
Site Admin


Joined: 11 Dec 2006
Posts: 269
Location: A'dam/Diemen, The Netherlands

update a real API is in planning but not for 1.2.7 ..
_________________
Phpbbantispam founder, available for freelance WordPress coding.

PhpBB2 mod: http://www.phpbbantispam.com/viewtopic.php?t=1
WordPress plugin: http://wordpress.org/extend/plugins/antispam-for-all-fields/
Project files & mailinglist: https://sourceforge.net/projects/phpbbantispam/

TOP View user's profileSend private messageVisit poster's website  BOTTOM
PostPosted: Tue Sep 18, 2007 7:18 pm    Post subject:  Reply with quote  

ramon fincken
Site Admin


Joined: 11 Dec 2006
Posts: 269
Location: A'dam/Diemen, The Netherlands

for some further reading Smile
see 1.2.8 new feature list: http://www.phpbbantispam.com/viewtopic.php?p=368#368
_________________
Phpbbantispam founder, available for freelance WordPress coding.

PhpBB2 mod: http://www.phpbbantispam.com/viewtopic.php?t=1
WordPress plugin: http://wordpress.org/extend/plugins/antispam-for-all-fields/
Project files & mailinglist: https://sourceforge.net/projects/phpbbantispam/

TOP View user's profileSend private messageVisit poster's website  BOTTOM
PostPosted: Sat Oct 20, 2007 3:07 pm    Post subject:  Reply with quote  

ramon fincken
Site Admin


Joined: 11 Dec 2006
Posts: 269
Location: A'dam/Diemen, The Netherlands

API has been made for 1.2.8 ( note option 2 Razz )


Api_test_clean.png


Api_test_spam.png



Instructionset found in: /contrib/function_api.txt
Code:
This function API is for advanced users only, if you have never created a 'mod' scip this part ..
There are 2 options:

1) Pure PHP

   Integrate your page with Phpbb
   
   It's fairly easy: if you have a field or var. you want to check just do this:
   Code:
      validate_spam($varname_over_here,'word');

   And the function will take care of the rest!
   Do NOT sent in array's ! Just full string/ints variables !
   
2) Use the antispam_api.php found in the contrib folder

   POST or GET page with params:
   @ api_key  string
   @ api_text string
   
   It requires the API key to be entered and the function to be enables in the admin.
   if api_text contains spam > 'SPAM' will be echo 'ed
   if api_text contains no spam > 'Looking clean' will be echo 'ed

   Example of the GET method:
   www.board.com/antispam_api.php?api_key=[KEY_HERE]&api_text=[TEXT_HERE]

   See api_test_spam.png and api_test_clean.png for examples.

   Do NOT sent in array's ! Just full string/ints variables !

_________________
Phpbbantispam founder, available for freelance WordPress coding.

PhpBB2 mod: http://www.phpbbantispam.com/viewtopic.php?t=1
WordPress plugin: http://wordpress.org/extend/plugins/antispam-for-all-fields/
Project files & mailinglist: https://sourceforge.net/projects/phpbbantispam/

TOP View user's profileSend private messageVisit poster's website  BOTTOM
 Post new topic   Reply to topic All times are GMT + 1 Hour

Display posts from previous:   
 PhpBB- & WordPress- antispam.com Forum Index » [PhpBB2] Feature requests » External API for blogs/forms/etc.
 
 Page 1 of 1
 
 
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Jump to:  


     Powered by phpBB © 2001, 2005 phpBB Group | Template Neon | Snelle Managed WordPress webhosting