Open source project to check status from a web page. This server can check and validate status using http status(200), search parts of html content and match a part of web page screen shot. All alerts will be delivery usin Slack
- Knowledge in javasscript
- Knowledge in Slack App
- "express": "^4.17.1",
- "image-downloader": "^3.5.0",
- "imgur": "^0.3.1",
- "looks-same": "^7.2.1",
- "nodemon": "^1.19.3",
- "phantom": "^6.3.0",
- "phantomjscloud": "^3.5.5",
- "sharp": "^0.23.1",
- "uuid": "^3.3.3"
Clone the repository
git clone https://github.com/cleberpereiradasilva/node-web-monitor.git
Change diretory
cd node-web-monitor
Install dependencies
yarn install
- Work in progress
yarn start
Wait for message
Example app listening on port 3000!
https://api.slack.com/messaging/webhooks
https://hooks.slack.com/services/
T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
This url part: T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
- End Point
GET http://localhost:3000/has/
- Parameters
- url to check
url
example:url=https://www.cvc.com.br/promoca/top-destinos/
- slack Key
slackKey
example:slackKey=/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
- text for search
exptected
example:exptected=Foz do Iguaçu
- url to check
- Full url
http://localhost:3000/has/?url=https://www.cvc.com.br/promoca/top-destinos/&slackKey=/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX&exptected=Foz do Iguaçu
-
End Point to save imagem in imgur
GET http://localhost:3000/save/
-
Parameters
- url to check
url
example:url=https://www.cvc.com.br/promoca/top-destinos/
- width
width
example:width=600
- height for search
height
example:height=324
- left for search
left
example:left=0
- top for search
top
example:top=0
- url to check
-
Full url
http://localhost:3000/save/?url=https://www.cvc.com.br/promoca/top-destinos/&width=600&height=324&left=0&top=0
-
The response is
image url
:https://i.imgur.com/099IFAM.png
4.2 Compare site with image from imgur
-
End Point to compare imagem in imgur. You can use another image url.
GET http://localhost:3000/check/
-
Parameters
- url to check
url
example:url=https://www.cvc.com.br/promoca/top-destinos/
- width
width
example:width=600
- height for search
height
example:height=324
- left for search
left
example:left=0
- top for search
top
example:top=0
- image url for check
image
example:image=https://i.imgur.com/099IFAM.png
- slack Key
slackKey
example:slackKey=/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
- url to check
-
Full url
http://localhost:3000/check/?url=https://www.cvc.com.br/promocao/top-destinos/&width=600&height=324&left=0&top=0&image=https://i.imgur.com/099IFAM.png&slackKey=/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
If it doesn't match the images, you'll get a message on your slack channel with both images to see the differences.
-
End Point to status
GET http://localhost:3000/status/
-
Parameters
- url to check
url
example:url=https://www.cvc.com.br/promoca/top-destinos/
- statusCode exptected
statusCode
example:statusCode=200
- slack Key
slackKey
example:slackKey=/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
- url to check
-
Full url
http://localhost:3000/status/?url=https://www.cvc.com.br/promocao/top-destinos/&statusCode=200&slackKey=/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
You can get all commands from an external API with json
body like this:
{
type: "check",
url: "https://www.cvc.com.br/promoca/top-destinos/",
width: "600",
height: "324",
left: "0",
top: "0",
image: "https://i.imgur.com/llK99r8.png",
slackKey: "/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
},
{
type: "has",
url: "https://www.cvc.com.br/promocao/top-destinos/",
exptected: "Foz do Iguaçua",
slackKey: "/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
},
{
type: "status",
url: "https://www.cvc.com.br/promocao/top-destinos/",
statusCode: "200",
slackKey: "/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
}
This example can be viewed at http://localhost/fake-api
To execute all returned items you can call by this URL http://localhost:3000/check-list/?url=http://localhost:3000/fake-api
- Java Script - The lenguage used
- NodeJS - The runtime framework used
- yarn - Dependency Management
- Cleber Silva - Initial work - cleberpereiradasilva
This project is licensed under the MIT License - see the LICENSE.md file for details
- Java Script
- Inspiration(Java Script)