WaGuns.org
https://www.waguns.org/

Run a script on new ads that prompts for "WTS"?
https://www.waguns.org/viewtopic.php?f=32&t=112316
Page 1 of 1

Author:  delliottg [ Wed Aug 26, 2020 2:22 pm ]
Post subject:  Run a script on new ads that prompts for "WTS"?

Nearly every day, several times a day, Steve has to go police the want to sell ads to prompt the sellers to change the title of their ad to include "WTS", or "WTT", or whatever to abide by the rules. I'm sure he enjoys this immensely.

It would seem like it would be easy to write a RegEx that tests each new add title looking for the variants of WTS / WTT, etc. and automatically send a PM to the offending ad writer, and / or auto respond in the thread so Steve doesn't have to do it all day every day.

So as an example using this simple regex: ^WTS|WTT|WTB|FT|FS
You would get a fail on the first two ad titles and a success on the last three on these I've pulled randomly from today

357 Black Talon
Poor mans bullet feeder 9mm. Hornady
WTS Once Fired 7.65x53 Rifle Brass
FS/FT: 7.62x45mm Czech ammo for VZ52 47 rounds total.
WTB: HK P30 LEM NO SAFETY

So pseudocode would go like this:

Code:
//declare a new regex for the strings you want to have in the ad
string re = new Regex("^WTS|WTT|WTB|FT|FS");
//check an array of new ads over the past hour or whatever:
string[] NewAdTitles = {
    "357 Black Talon",
    "Poor mans bullet feeder 9mm. Hornady",
    "WTS Once Fired 7.65x53 Rifle Brass",
    "FS/FT: 7.62x45mm Czech ammo for VZ52 47 rounds total.",
    "WTB: HK P30 LEM NO SAFETY" };
//look for a non-match in the ad title, if the required substrings aren't found somewhere in the string, send reminders to offending authors
foreach(string s in NewAdTitles)
{    if(!re.match(s)
    {
        sendMailToRemindAuthorToFollowRules(s.author);
        autoRespondInAdSoSteveDoesntHaveTo(s)
    }
}

Author:  Massivedesign [ Wed Aug 26, 2020 5:43 pm ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

The new software, when we get around to it, will have strict rules built into the classifieds that require a suffix.

Author:  usrifle [ Wed Aug 26, 2020 6:10 pm ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

All the WTS ad's that are wrong and need policing give Steve meaning.
He loves that shit.
Oh, and don't bump your ad early or make any chit chat either. He is on that shit like a Pitbull on a Pork Chop.
You won't even have time to edit once you hit "submit" before the PM comes. :peep:

Author:  Massivedesign [ Wed Aug 26, 2020 6:19 pm ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

Steve really only has one purpose in life, and that's to police us.

Author:  MadPick [ Wed Aug 26, 2020 8:39 pm ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

Massivedesign wrote:
The new software, when we get around to it....


Image

Oh, I'm ready to give my one purpose, any time . . . I wouldn't miss it for a second.

Author:  Sinus211 [ Wed Aug 26, 2020 10:30 pm ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

usrifle wrote:
All the WTS ad's that are wrong and need policing give Steve meaning.
He loves that shit.
Oh, and don't bump your ad early or make any chit chat either. He is on that shit like a Pitbull on a Pork Chop conspiracy theory.
You won't even have time to edit once you hit "submit" before the PM comes. :peep:

Early bumps are my domain dammit! :bitchfight:

Author:  usrifle [ Wed Aug 26, 2020 11:25 pm ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

Sinus211 wrote:
usrifle wrote:
All the WTS ad's that are wrong and need policing give Steve meaning.
He loves that shit.
Oh, and don't bump your ad early or make any chit chat either. He is on that shit like a Pitbull on a Pork Chop conspiracy theory.
You won't even have time to edit once you hit "submit" before the PM comes. :peep:

Early bumps are my domain dammit! :bitchfight:


Not with Steve "Working" from home. :wink05:

Author:  Massivedesign [ Thu Aug 27, 2020 5:36 am ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

I think Steve leaves us nuggets, so we feel like we are a part of the team too. Or, he's testing us.

Author:  KeystoneCowboy [ Thu Aug 27, 2020 6:53 am ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

Bump

Author:  Selador [ Thu Aug 27, 2020 9:20 am ]
Post subject:  Re: Run a script on new ads that prompts for "WTS"?

delliottg wrote:
Nearly every day, several times a day, Steve has to go police the want to sell ads to prompt the sellers to change the title of their ad to include "WTS", or "WTT", or whatever to abide by the rules. I'm sure he enjoys this immensely.

It would seem like it would be easy to write a RegEx that tests each new add title looking for the variants of WTS / WTT, etc. and automatically send a PM to the offending ad writer, and / or auto respond in the thread so Steve doesn't have to do it all day every day.

So as an example using this simple regex: ^WTS|WTT|WTB|FT|FS
You would get a fail on the first two ad titles and a success on the last three on these I've pulled randomly from today

357 Black Talon
Poor mans bullet feeder 9mm. Hornady
WTS Once Fired 7.65x53 Rifle Brass
FS/FT: 7.62x45mm Czech ammo for VZ52 47 rounds total.
WTB: HK P30 LEM NO SAFETY

So pseudocode would go like this:

Code:
//declare a new regex for the strings you want to have in the ad
string re = new Regex("^WTS|WTT|WTB|FT|FS");
//check an array of new ads over the past hour or whatever:
string[] NewAdTitles = {
    "357 Black Talon",
    "Poor mans bullet feeder 9mm. Hornady",
    "WTS Once Fired 7.65x53 Rifle Brass",
    "FS/FT: 7.62x45mm Czech ammo for VZ52 47 rounds total.",
    "WTB: HK P30 LEM NO SAFETY" };
//look for a non-match in the ad title, if the required substrings aren't found somewhere in the string, send reminders to offending authors
foreach(string s in NewAdTitles)
{    if(!re.match(s)
    {
        sendMailToRemindAuthorToFollowRules(s.author);
        autoRespondInAdSoSteveDoesntHaveTo(s)
    }
}

Dude!

You left out the part where it asks for credit card info, then sends me two bucks!

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/