Clean users / post in bulk from a plugin



  • Hi!
    I'm trying to clean my users/post list, I want to delete in bulk all the users without posts, I'm trying to write my own plugin to achieve that, I've seen that the User module has a delete user, I can require the module from the plugin library, but how can I call from the admin.js.
    I've also checked the write API plugin, but I was unable to use the cURL from a js script, I'm using node-libcurl.
    What is the best way to achieve that? how can I delete the users from my forum in js, or can I call a custom hook in my plugin?

    Sorry if it's a dumb question, and thank you for your time.


  • Community Rep

    Make sure you include an option for "how long ago" to do the deletion. You don't want to delete an account just a few minutes or even hours old. You might want to make it like "one year old and older" but just make it an option that the end user can select.


  • GNU/Linux

    @scottalanmiller said in Clean users / post in bulk from a plugin:

    Make sure you include an option for "how long ago" to do the deletion. You don't want to delete an account just a few minutes or even hours old. You might want to make it like "one year old and older" but just make it an option that the end user can select.

    Checking last active might be a choice. Often people will sign in and simply never post, but continue to read content.


  • Community Rep

    @JaredBusch said in Clean users / post in bulk from a plugin:

    @scottalanmiller said in Clean users / post in bulk from a plugin:

    Make sure you include an option for "how long ago" to do the deletion. You don't want to delete an account just a few minutes or even hours old. You might want to make it like "one year old and older" but just make it an option that the end user can select.

    Checking last active might be a choice. Often people will sign in and simply never post, but continue to read content.

    Yes, good point. That's why we only do it by hand. If the account seems valid, best to leave it. empty accounts don't really do any damage.


  • GNU/Linux Admin

    @Enrique the main problem you seem to be having is that you are not aware that there is a frontend and a backend to NodeBB. You have to wire up the controls from the ACP and make a call to the backend (via websocket, for example), and then you can call server side libraries.


Log in to reply
 

Suggested Topics

  • 5
  • 3
  • 4
  • 11
  • 1
| |