SHOW:
|
|
- or go back to the newest paste.
| 1 | ######## MIKROTIK - DIAY GRAPHING CAPTURE REPORT - LINE ######### | |
| 2 | # # | |
| 3 | - | # build 0.2.20231105 public review # |
| 3 | + | # build 0.3.20230616 public review # |
| 4 | # BY: PHUKAO PONGSUWAN # | |
| 5 | # # | |
| 6 | - | # LINE Script: https://pastebin.com/Jk9kjH2A # |
| 6 | + | # * * * * FOR ROS v7.10++ please use * * * * * # |
| 7 | - | # TELEGRAM Script: https://pastebin.com/v6RCJqBh # |
| 7 | + | |
| 8 | # TELEGRAM Script: https://pastebin.com/jnRBkwCx # | |
| 9 | - | # * * * * IF USE ROS > v7.10 please use * * * * * # |
| 9 | + | |
| 10 | # Capture with https://github.com/elestio/ws-screenshot # | |
| 11 | # # | |
| 12 | # fix 20231105 - add uniq value in url to avoid caching # | |
| 13 | # fix 20230616 - update uniq for ROS 7.10++ to more Uniq with date # | |
| 14 | # # | |
| 15 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
| 16 | ||
| 17 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
| 18 | # # | |
| 19 | # !!! NEED THIS SCRIPT "func_LINEdateTime" as INCLUDE FIELS !!!! # | |
| 20 | # # | |
| 21 | # https://pastebin.com/tznx0BSu # | |
| 22 | # # | |
| 23 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
| 24 | ||
| 25 | # Multiple interface use => | |
| 26 | # | |
| 27 | # :local interfaces { "<interface-name-1>"; "<interface-name-2>"; "<interface-name-n>" }
| |
| 28 | ||
| 29 | :local interfaces { "<interface-name>" }
| |
| 30 | :local token "<LINE_API_TOKEN>"; | |
| 31 | :local domainWS "<DOMAIN_OR_IP_WS-CAPTURE-SERVICE>" | |
| 32 | :local domianGRAPH "<IP_PORT_TO_GRAPH>" | |
| 33 | :local msg "<MESSAGE TEXT>" | |
| 34 | ||
| 35 | ||
| 36 | ||
| 37 | :foreach inf in=$interfaces do={
| |
| 38 | :local datetime [[:parse [/system/script/get func_LINEdateTime source]]] | |
| 39 | :local uniq ([/system clock get date]."-".[:rndnum from=100000 to=999999]) | |
| 40 | :local url "https://$domainWS/api/screenshot%3Funiq=$uniq%26resX=1024%26resY=500%26outFormat=png%26waitTime=50%26isFullPage=true%26url=http://$domianGRAPH/graphs/iface/$inf/" | |
| 41 | - | :local uniq [:rndnum from=100000 to=999999] |
| 41 | + | |
| 42 | :local postmsg "message=$msg$inf\n$datetime&imageThumbnail=$url&imageFullsize=$url" | |
| 43 | ||
| 44 | /tool/fetch http-method=post \ | |
| 45 | http-header-field="Content-Type: application/x-www-form-urlencoded\nAuthorization: Bearer $token" \ | |
| 46 | http-data=$postmsg \ | |
| 47 | https://notify-api.line.me/api/notify \ | |
| 48 | output=none | |
| 49 | ||
| 50 | :log info ("LINE Notify: $msg$inf")
| |
| 51 | } |