{"id":20331163,"url":"https://github.com/comcast/watchmen-ping-puppeteer","last_synced_at":"2025-04-11T21:07:39.907Z","repository":{"id":33881571,"uuid":"151747484","full_name":"Comcast/watchmen-ping-puppeteer","owner":"Comcast","description":"Watchmen ping plugin using puppeteer","archived":false,"fork":false,"pushed_at":"2022-12-30T20:03:49.000Z","size":528,"stargazers_count":3,"open_issues_count":8,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T21:07:33.390Z","etag":null,"topics":["monitoring-plugins","puppeteer","watchmen"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Comcast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-05T16:15:47.000Z","updated_at":"2022-03-30T01:50:10.000Z","dependencies_parsed_at":"2023-01-15T03:08:12.357Z","dependency_job_id":null,"html_url":"https://github.com/Comcast/watchmen-ping-puppeteer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fwatchmen-ping-puppeteer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fwatchmen-ping-puppeteer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fwatchmen-ping-puppeteer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fwatchmen-ping-puppeteer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comcast","download_url":"https://codeload.github.com/Comcast/watchmen-ping-puppeteer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480435,"owners_count":21110937,"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":["monitoring-plugins","puppeteer","watchmen"],"created_at":"2024-11-14T20:19:01.947Z","updated_at":"2025-04-11T21:07:39.876Z","avatar_url":"https://github.com/Comcast.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/Comcast/watchmen-ping-puppeteer.svg?branch=master)](https://travis-ci.com/Comcast/watchmen-ping-puppeteer)\n\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/Comcast/watchmen-ping-puppeteer.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/Comcast/watchmen-ping-puppeteer/alerts/)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/Comcast/watchmen-ping-puppeteer.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/Comcast/watchmen-ping-puppeteer/alerts/)\n\nFeed a [Puppeteer](puppeteer) script to [Watchmen](watchmen) to run synthetic monitoring.\n\nIn your Watchmen directory:\n`npm install watchmen-ping-puppeteer --save`\n\n### How To Use:\n- *Important* This runs on Node v7.4 or higher to use async/await otherwise, you'll have to compile down.\n- Create a Puppeteer script with a `.js` extension\n\n```javascript\nconst puppeteer = require('puppeteer');\n\nasync function getImageAltText() {\n  const browser = await puppeteer.launch();\n  const page = await browser.newPage();\n  await page.goto('https://my.xfinity.com');\n\n  let selector = '.xfinity-logo';\n  let imageSelector = await page.$('img');\n  let getImage = await page.evaluate(image =\u003e image.alt, imageSelector);\n  try {\n    await page.waitForSelector(selector).then(getImage);\n  } catch (err) {\n    const browserClose = await browser.close();\n    return `Failed to retrieve selector ${err}`;\n  }\n  browser.close();\n\n  if (getImage === 'comcast official logo, xfinity official logo') {\n    return 'Title Found';\n  } else {\n    throw 'Failure: title does not match';\n  }\n}\n\ngetImageAltText().then(success =\u003e {\n  console.log(success);\n  return success;\n}).catch(err =\u003e {\n  process.exitCode = 1;\n  console.log(err);\n  return err;\n});\n```\n\n- Copy your `.js` file to a directory on your Watchmen instance\n- After uploaded - click add new service and select ping service `puppeteer`\n- In Ping options `scriptPath` put full file path and file name\n- Click `Save` and you'll be on your way!\n\nPlease read `CONTRIBUTING.md` for how to contribute to the project.\n\nAny issues/comments/questions, please file an issue and we'll respond.\n\n---\n\nCopyright 2018 Comcast Cable Communications Management, LLC\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\n[puppeteer]: https://github.com/GoogleChrome/puppeteer\n[watchmen]: https://github.com/iloire/watchmen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fwatchmen-ping-puppeteer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomcast%2Fwatchmen-ping-puppeteer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fwatchmen-ping-puppeteer/lists"}