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

Use lzstring R package for encode/decode Shinylive URL functions #92

Open
wants to merge 2 commits into
base: feat/encode-decode-url
Choose a base branch
from

Conversation

parmsam
Copy link

@parmsam parmsam commented Jun 16, 2024

Based on great work from @gadenbuie shared in #70 that used original JS implementation via V8. This PR switches over to lzstring package, updates url_encode_dir(), and adds url_decode() based on the Python implementation here and here. Nearly there, just seems to add an empty line at the end of scripts on the URL decode. Not complete but aims to get work started again.

Example to try out:
shinylive:::url_decode(encoded_url = "https://shinylive.io/r/editor/#code=NobwRAdghgtgpmAXAAjFADugdAJTAGlQGMB7CAFzgqVQBsBLAIwCcpmBPACgGcALeiOwCUAHQhiAxMgAicAGYC4yAKoBJZHJLNkGdMnK8o5ZABNWAd247k-buRIBzVjGQBad67EBXesgA8rhq0PiYAClAOcJxiyMgxyFIAgpj69OS0Sh6eELHkaRnhEHC00WAAEsW0JMgAyvyCAIQiYEL48fFSNfQmcIxsyLRQ7CRexuZpvMgC6KM6ECbII+Qzxj0KEGn0ZFZZ8dzdvWwAMkNL0TmxcRexnQd92uhQRbQaWlMQKzse8bH7PfeFYrnS6XH6XKSqD6jFA1Bg9bSabQGJQQLwwRhwbQkOTIRgCL7uMG-OGYyErTjTUaqBYAXjiYDxEG4zTa1xB7I5gwxLzpzQAcmiMVicYzuIgWUSOVKYAJkHSAIysqXKy4wKAADzlyAArAAGJUq5UANygwSUdIAzLrRGzYmDWmCwVIALJQWWPZ6vbQmejcdCDdgCByLUafNzfNlqgSAkqSyVSADyoehyDKvvsTlg4cJtuQ-pI5CTy1GnCWK2pWuaPrsoSq5GaNo59viNptkhk8kUyG4mKNmIGjnoRGQzDgAEcfKOFvZTBZrLYM85s9ke8w+9oAhovBAiHkyBSoeRCGXRkJkCB2hcpGm7I4l9j9LwlAnaAsAGJugxyLwvADicHYVcZCMKBlw6ZBxgMEdxy8OA7DgBZUXRfsH1FcCABVbGQOB1XQUduH2MhHyMZBIiKVhKCsUCFzvLNfQg1hMAQ95rCIU1aHAmdR3mTFawLfRqgEH02MoYjyHFK9wPlLBkFUYx6OaUcoF3eg+2aOZpyfUdESUPgRlfXElCgUYSDVPI2NoWh2HAy5R1cHC4CIUZmPMJ8ckpcgrAPFYABJRTPIhDAgSJwIAJhkuSrBPYxyHYdAlHo0D83rC5op86tyD44xN24+Ess4C82TBTVLk3ORP14b9aB88xPyDMFRX8QIezHTgZQgTh1VaZA1XVTruoyYKDCwJYtQ8vz8WQABqZB5UbUE2QXTrCBYOAoAAaysOlRUIUgeXpCQAHZtUSRJpAAIRZXEtHhSswFctI4AlXNLnVLk7oAdTq4LUngATkCKdVjExLx0D3HIDx6-FRAISVVTdHJeXKdNaJcB9as2H68ngZkWkdC4AF95rEAmxHbABhJTRLqAR2B0FJdiZep2GSdBOB8LUfEIVd1y1HnMRtAhUFi+KaDASggbAAmAF0gA", dir = "shinylive_test_code")

shinylive:::url_encode_dir("shinylive_test_code")

@parmsam
Copy link
Author

parmsam commented Aug 14, 2024

@wch - Following up on this based on our in-person conversation today. Thanks!

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 this pull request may close these issues.

1 participant