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

Invalid json for webhook on appdata backup #186

Closed
GeneralPractitioner-GP opened this issue Jul 24, 2024 · 3 comments
Closed

Invalid json for webhook on appdata backup #186

GeneralPractitioner-GP opened this issue Jul 24, 2024 · 3 comments

Comments

@GeneralPractitioner-GP
Copy link
Contributor

Hi,

I noticed that some of the jokes result in invalid JSON as they contain double quotes.

Example

{
    "text": "Powered by: Drazzilb | A photon checks into a hotel. Receptionist: "May I take your bags sir?" Photon: "I don't have any bags, I'm travelling light.""
}

The double quotes should either be made single quotes or escaped

{
    "text": "Powered by: Drazzilb | A photon checks into a hotel. Receptionist: \"May I take your bags sir?\" Photon: \"I don't have any bags, I'm travelling light.\""
}

I've modified the joke line to be

joke=$(curl -s https://raw.githubusercontent.com/Drazzilb08/daps/master/jokes.txt | shuf -n 1 | sed 's/"/\\"/g')
@Drazzilb08
Copy link
Owner

Good find. I'll add this in unless you want to slap a PR together.

@GeneralPractitioner-GP
Copy link
Contributor Author

Made a PR :)
#187

@Drazzilb08
Copy link
Owner

Merged it. Thanks a bunch

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

No branches or pull requests

2 participants