AsudoxDev

joined 6 months ago
[–] AsudoxDev 2 points 1 week ago (1 children)

holy fucking shit it finally works

[–] AsudoxDev 6 points 1 week ago* (last edited 1 week ago) (1 children)

I would've considered buying this. That's a good deal.

[–] AsudoxDev 1 points 1 week ago

here, it definitely is shorter, I'll keep filter_map in mind, thanks:

fn get_links(mut link_nodes: Select) -> Vec<String> {
    link_nodes.into_iter().filter_map(|node| node.value().attr("href").map(|href| href.to_string())).collect()
}
[–] AsudoxDev 2 points 2 weeks ago* (last edited 2 weeks ago)

it answers your question. you don't expect me to spoon feed you, do you? learn how to read documentations

[–] AsudoxDev 3 points 2 weeks ago

Vanilla Arch.

[–] AsudoxDev 5 points 2 weeks ago (6 children)

What source? That was obvious sarcasm.

[–] AsudoxDev 1 points 2 weeks ago* (last edited 1 week ago) (2 children)

Here's what you are trying to do, with a one liner:

fn get_links(mut link_nodes: Select) -> Vec<String> {
    link_nodes.retain(|node| node.value().attr("href").is_some()).into_iter().fold(Vec::new(), |links, node| links.push(link.value().attr("href").unwrap().to_string()))
}

edit: shorter and updated version:

fn get_links(mut link_nodes: Select) -> Vec<String> {
    link_nodes.into_iter().filter_map(|node| node.value().attr("href").map(|href| href.to_string())).collect()
}

The retain method is to get rid of all the nodes which don't have a href attribute and the fold method after it is to extract the href out of the nodes and push them into the vector.

It might work or not, I've written this from my memory and I can't exactly know what that Select is.

I also hope you begin reading The Book without half assing it.

[–] AsudoxDev 7 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

No problem calling third parties Russian spies without evidence. But waging a genocide does not make one a Nazi.

I don't care what americans say about third parties, I am not one of them, nor do I want to be one. I simply stated that a nazi is not one who supports genocide, by definition. Would you call helping some random stranger that happens to be supporting trump (which supports genocide) helping a nazi intentionally?

By your logic, anyone that supports genocide is a trump fan, hitler fan, etc.

[–] AsudoxDev 4 points 2 weeks ago (1 children)

Linux was optimized to be used as a desktop OS?

[–] AsudoxDev 6 points 2 weeks ago (6 children)

By the actual definition, that is wrong. https://en.wikipedia.org/wiki/Nazism

[–] AsudoxDev 15 points 2 weeks ago (1 children)

Link to presentation?

19
submitted 3 months ago* (last edited 3 months ago) by AsudoxDev to c/[email protected]
 

cross-posted from: https://programming.dev/post/18411894

Hello Lemmings!

I am thinking of making a community moderation bot for Lemmy. This new bot will have faster response times with the help of Lemmy webhooks, an amazing plugin for Lemmy instances by @[email protected] to add webhook support. With this, there is no need to frequently call the API at a fixed interval to fetch new data. Any new data will be sent via the webhook directly to the bot backend. This allows for actions within seconds, thus making it an effective auto moderation tool.

I have a few features I thought of doing:

  • Welcome messages
  • Auto commenting on new posts
  • Scheduled posts
  • Punish content authors or take action on content via word blacklist/regex
  • Ban members of communities by their usernames/bios via word blacklist or regex
  • Auto community lockdown during spam

What other features do you think are possible? Please let me know. Any questions are also welcome.

Community requested features:

  • Strike system

Strikes are added to a certain member of the community and the member will be temporarily banned within a time period if their strike count reaches a certain threshold

  • Post creation restriction by account age

If an account's age is lower than X, remove the post.

35
submitted 3 months ago* (last edited 3 months ago) by AsudoxDev to c/[email protected]
 

cross-posted from: https://programming.dev/post/18411894

Hello Lemmings!

I am thinking of making a community moderation bot for Lemmy. This new bot will have faster response times with the help of Lemmy webhooks, an amazing plugin for Lemmy instances by @[email protected] to add webhook support. With this, there is no need to frequently call the API at a fixed interval to fetch new data. Any new data will be sent via the webhook directly to the bot backend. This allows for actions within seconds, thus making it an effective auto moderation tool.

I have a few features I thought of doing:

  • Welcome messages
  • Auto commenting on new posts
  • Scheduled posts
  • Punish content authors or remove content via word blacklist/regex
  • Ban members of communities by their usernames/bios via word blacklist or regex
  • Auto community lockdown during spam

What other features do you think are possible? Please let me know. Any questions are also welcome. Community requested features:

  • Strike system

Strikes are added to a certain member of the community and the member will be temporarily banned within a time period if their strike count reaches a certain threshold

  • Post creation restriction by account age

If an account's age is lower than X, remove the post.

6
submitted 3 months ago* (last edited 3 months ago) by AsudoxDev to c/[email protected]
 

cross-posted from: https://programming.dev/post/18411894

Hello Lemmings!

I am thinking of making a community moderation bot for Lemmy. This new bot will have faster response times with the help of Lemmy webhooks, an amazing plugin for Lemmy instances by @[email protected] to add webhook support. With this, there is no need to frequently call the API at a fixed interval to fetch new data. Any new data will be sent via the webhook directly to the bot backend. This allows for actions within seconds, thus making it an effective auto moderation tool.

I have a few features I thought of doing:

  • Welcome messages
  • Auto commenting on new posts
  • Scheduled posts
  • Punish content authors or remove content via word blacklist/regex
  • Ban members of communities by their usernames/bios via word blacklist or regex
  • Auto community lockdown during spam

What other features do you think are possible? Please let me know. Any questions are also welcome.

Community requested features:

  • Strike system

Strikes are added to a certain member of the community and the member will be temporarily banned within a time period if their strike count reaches a certain threshold

  • Post creation restriction by account age

If an account's age is lower than X, remove the post.

43
submitted 3 months ago* (last edited 3 months ago) by AsudoxDev to c/[email protected]
 

Hello Lemmings!

I am thinking of making a community moderation bot for Lemmy. This new bot will have faster response times with the help of Lemmy webhooks, an amazing plugin for Lemmy instances by @[email protected] to add webhook support. With this, there is no need to frequently call the API at a fixed interval to fetch new data. Any new data will be sent via the webhook directly to the bot backend. This allows for actions within seconds, thus making it an effective auto moderation tool.

I have a few features I thought of doing:

  • Welcome messages
  • Auto commenting on new posts
  • Scheduled posts
  • ~~Punish content authors or take action on~~ Auto report content via word blacklist/regex
  • Ban members of communities by their usernames via word blacklist or regex
  • Auto community lockdown during spam

What other features do you think are possible? Please let me know. Any questions are also welcome.

Community requested features:

  • Strike system

Strikes are added to a certain member of the community and the member will be temporarily banned within a time period if their strike count reaches a certain threshold

  • Post creation restriction by account age

If an account's age is lower than X, remove the post.

view more: ‹ prev next ›