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

add mmore function #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

add mmore function #3

wants to merge 3 commits into from

Conversation

Cloud-Dark
Copy link
Contributor

@Cloud-Dark Cloud-Dark commented Nov 28, 2023

Description:

This pull request introduces new functionality for creating and displaying Base64. It includes the following changes:

  • generateQRCodeDialog(text): This function displays a dialog box containing a QR code based on the provided text. The QR code is generated using the generateQRCodeUrl(text) function, and the dialog box is shown using the SpreadsheetApp's UI service.
  • generateQRCodeUrl(text): This function generates a URL for a QR code image based on the provided text. The text is encoded and appended to the Google Chart API URL, which generates the QR code image. The generated URL is returned.
  • generateQRCodeAndLogBase64(text): This function generates a base64-encoded image of the QR code based on the provided text. It utilizes the generateQRCodeBase64(text) function to fetch the QR code image from the Google Chart API, convert it to a base64-encoded format, and log the result using the Logger service.
  • generateQRCodeBase64(text): This function generates a base64-encoded image of the QR code based on the provided text. It fetches the QR code image from the Google Chart API, converts it to a blob of type 'image/png', and then encodes the blob to base64 format using the Utilities service. The resulting base64-encoded image is returned.
  • alertMaker(message, status): This function displays a pop-up/alert in the spreadsheet. It takes a message and status as parameters, allowing customization of the alert's content and appearance. The SpreadsheetApp's UI service is used to show the alert.
  • spinText(text): This function spins and replaces text within curly braces. It takes a text string as input and uses regular expressions to match patterns enclosed in curly braces. The function randomly selects one of the choices separated by a pipe ('|') and replaces the entire match with the selected choice. The spun and replaced text is returned.
  • removeDuplicates(): This function removes duplicate rows from the current sheet of the active spreadsheet. It utilizes the SpreadsheetApp's methods to retrieve the data range, iterate through the rows, and create a uniqueData object with row values as keys. The sheet is then cleared, and the unique rows are written back to the sheet.
  • checkServer(url): This function checks the status of a website URL or server by making an HTTP request to the specified URL. It returns true if the response code is 200, indicating that the server is online, and false otherwise. Exception handling is implemented to handle errors that may occur during the request.
  • setValue(worksheet, cellcolumn, value): This function sets the value of a column in a spreadsheet without linking to the sheet. It takes the worksheet name, column identifier, and value as parameters and uses the SpreadsheetApp's methods to access the specified sheet and cell. The cell value is then set to the provided value.
  • convertSpreadsheetToPDF(spreadsheetId, sheetName, folderId): This function converts the specified sheet in a spreadsheet to a PDF file and saves it in the specified Google Drive folder. It constructs a URL with export settings for the PDF conversion and uses the UrlFetchApp's fetch method to retrieve the PDF blob. The blob is then saved as a PDF file in the designated folder, and the ID of the created file is returned.

Contributor Guidelines Followed:

  • Followed the coding style and guidelines specified in the project.
  • Documented the code changes and added inline comments where necessary.
  • Ensured the code is readable, maintainable, and adheres to best practices.

Please review this pull request and merge it into the main branch if approved.

add more function
add alert maker
add create qr code, change description to english
@Cloud-Dark Cloud-Dark changed the title Adding Base64 Creation Functionality and QR Code Display add mmore function Nov 28, 2023
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.

None yet

1 participant