Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding filter for exluding explicit content to chuck-norris-source #511

Closed
rhuss opened this issue Sep 16, 2021 · 5 comments · Fixed by #512
Closed

Adding filter for exluding explicit content to chuck-norris-source #511

rhuss opened this issue Sep 16, 2021 · 5 comments · Fixed by #512

Comments

@rhuss
Copy link
Contributor

rhuss commented Sep 16, 2021

I love the chuck-norris-source, and would like to use them in demos, but a bit afraid of showing up a quote like in https://api.chucknorris.io/jokes/7xoo4cjutwu3sgmuelp2pw during a customer demo ;-P While not necessarily not funny, it might confuse the audience a bit.

Would it be possible to add a filter from a bad-word list to

- to: "http://api.icndb.com/jokes/random"
- set-body:
jsonpath: "$.value.joke"
- to: "kamelet:sink"
and just retry if a word of the list is matched? My Camel foo is unfortunately not good enough to add the corresponding steps ...

@rhuss rhuss changed the title Adding filter for offensive wording to chuck-norris-source Adding filter for offending wording to chuck-norris-source Sep 16, 2021
@rhuss
Copy link
Contributor Author

rhuss commented Sep 16, 2021

I just see, that there is a field "explicit" in the jokes, so maybe better filter on that (and possibly allow an option for the sink to also allow explicit jokes)

@rhuss
Copy link
Contributor Author

rhuss commented Sep 16, 2021

{ "type": "success", "value": { "id": 71, "joke": "....", "categories": ["explicit"] } }

@nicolaferraro
Copy link
Member

Yeah, there's also a filter in the URL, like: http://api.icndb.com/jokes/random?limitTo=[,nerdy]

If you just change that in the kamelet definition of your demo you should filter out explicit stuff.

We may also add an option in the Kamelet to toggle them.

@rhuss
Copy link
Contributor Author

rhuss commented Sep 16, 2021

It would be cool, to allow a 'safe' set by default and only enable explicit things if, well, explicitly requested :).

Also, if you set a category you also filter out all quotes without a category (which most of them are)

@rhuss
Copy link
Contributor Author

rhuss commented Sep 16, 2021

rhuss added a commit to rhuss/camel-kamelets that referenced this issue Sep 16, 2021
A future extension could add a parameter to re-enable explicite qoutes,
but for now I think it is safer to disable to avoid offending
people when using the source in demos.

Fixes apache#511.
@rhuss rhuss changed the title Adding filter for offending wording to chuck-norris-source Adding filter for exluding explicit content to chuck-norris-source Sep 16, 2021
oscerd pushed a commit that referenced this issue Sep 16, 2021
A future extension could add a parameter to re-enable explicite qoutes,
but for now I think it is safer to disable to avoid offending
people when using the source in demos.

Fixes #511.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants