{"id":17761687,"url":"https://github.com/pathoschild/webscript-helpers","last_synced_at":"2025-10-06T11:07:48.361Z","repository":{"id":137218818,"uuid":"44554917","full_name":"Pathoschild/webscript-helpers","owner":"Pathoschild","description":"A collection of generic scripts for writing Webscript.io webhooks.","archived":false,"fork":false,"pushed_at":"2015-11-05T22:12:34.000Z","size":172,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T08:48:54.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pathoschild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-19T18:26:05.000Z","updated_at":"2024-04-19T16:35:57.000Z","dependencies_parsed_at":"2023-03-13T16:33:03.001Z","dependency_job_id":null,"html_url":"https://github.com/Pathoschild/webscript-helpers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pathoschild%2Fwebscript-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pathoschild%2Fwebscript-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pathoschild%2Fwebscript-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pathoschild%2Fwebscript-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pathoschild","download_url":"https://codeload.github.com/Pathoschild/webscript-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246651504,"owners_count":20811991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T19:42:47.310Z","updated_at":"2025-10-06T11:07:43.323Z","avatar_url":"https://github.com/Pathoschild.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"A collection of simple Lua modules for writing Webscript.io webhooks. They\n[can be imported directly on Webscript.io](https://www.webscript.io/documentation#modules)\nusing the module name. For example:\n\n```lua\nlocal tokeniser = require('Pathoschild/webscript-helpers/tokeniser')\n```\n\nThis is an early experiment for my own use; it has few features and may change\nat any time.\n\n### Tokeniser\nThis module extracts tokens from arbitrary text. It's mainly intended for\nwebhooks that need to parse text payloads.\n\nFor example, Amazon Web Services sends alert emails that look like this:\n\u003e **AWS Elastic Beanstalk Notification - New application version was deployed\n\u003e to running EC2 instances**\n\u003e \n\u003e Timestamp: Fri Oct 16 15:40:00 UTC 2015  \n\u003e Message: New application version was deployed to running EC2 instances.  \n\u003e Environment: sample-api-edge  \n\u003e Application: sample-api  \n\u003e Environment URL: http://sample-api-edge.elasticbeanstalk.com\n\nThis module lets you tokenise simple strings like the subject:\n\n```lua\nlocal service, subject = tokeniser.capture(payload.subject, \"^AWS ([^-]+) Notification - (.+)\")\n```\n\nOr tokenise complex strings:\n\n```lua\nlocal tokens = {}\ntokeniser.parse(tokens, payload.body, {\n   timestamp = \"Timestamp: ([^\\r\\n]+)\",\n   message = \"Message: ([^\\r\\n]+)\",\n   environment = \"Environment: ([^\\r\\n]+)\",\n   environmentUrl = \"Environment URL: ([^\\r\\n]+)\",\n   application = \"Application: ([^\\r\\n]+)\"\n})\n```\n\n(See docstrings in the Lua file for details.)\n\n### Slack\nThis module provides a minimal Slack client for using an 'Incoming WebHooks'\nintegration configured via Slack.\n\nBasic usage:\n\n```lua\nlocal client = slack.getClient('https://incoming-webhook-url')\nclient.post('Hi there!')\n```\n\nYou can also customise the display name, avatar URL, and channel. (See\ndocstrings in the Lua file for details.)\n\n### Error monitoring\nThis module provides utilities for error-monitoring webhooks on Webscript.io.\n\nThe most basic usage sends an email alert to the webhook owner when an error occurs:\n\n```lua\nreturn monitoring.get('AWS event', request).monitor(function()\n\t-- webhook code goes here\nend)\n```\n\nYou can also specify error handlers, which are just functions that accept three\narguments (error, request, webhook name), and return `true` (handled) or `false`\n(not handled). For example, this code notifies a Slack channel when a webhook\nthrows an error:\n\n```lua\nmonitoring.get('AWS event', request, {monitoring.getSlackNotifier(slack)}).monitor(function()\n\t-- webhook code goes here\nend)\n```\n\n(See docstrings in the Lua file for details.)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpathoschild%2Fwebscript-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpathoschild%2Fwebscript-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpathoschild%2Fwebscript-helpers/lists"}