Last active
January 25, 2026 13:53
-
-
Save love4taylor/28c15e87354225182b36d178be29f2ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** | |
| [task_local] | |
| event-interaction https://gist.githubusercontent.com/love4taylor/28c15e87354225182b36d178be29f2ca/raw/ip_address_fraud_check.js, tag=IP ๆฌบ่ฏๆฅ่ฏข, img-url=link.circle.system, enabled=true | |
| @love4taylor, forked from @XIAO_KOP | |
| **/ | |
| // var content= `<p style="text-align: center; font-family: -apple-system; font-size: large; font-weight: bold">` + response.body + `</p>`; | |
| let base_url = "https://scamalytics.com/ip/" | |
| const userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.2 Safari/605.1.15" | |
| var url = "https://api.ip.sb/geoip" | |
| var opts = { | |
| policy: $environment.params | |
| }; | |
| var myRequest = { | |
| url: url, | |
| opts: opts, | |
| timeout: 4000, | |
| headers: { "User-Agent": userAgent } | |
| }; | |
| var message = "" | |
| const paras = ["ip", "isp", "country_code", "city"] | |
| const paran = ["IP", "ISP", "ๅฐๅบ", "ๅๅธ"] | |
| $task.fetch(myRequest).then(response => { | |
| message = response ? json2info(response.body, paras) : "" | |
| let ip = JSON.parse(response.body)["ip"] | |
| var myRequest1 = { | |
| url: base_url + ip, | |
| opts: opts, | |
| timeout: 4000, | |
| headers: { "User-Agent": userAgent } | |
| }; | |
| $task.fetch(myRequest1).then(response => { | |
| message = message + Display(response.body) | |
| console.log("url: " + base_url + ip + "\n\n" + message) | |
| message = message + "------------------------------" + "</br>" + "<font color=#6959CD>" + "<b>่็น</b> โ " + $environment.params + "</font>" | |
| message = `<p style="text-align: center; font-family: -apple-system; font-size: large; font-weight: thin">` + message + `</p>` | |
| $done({ "title": "๐ IP ๆฌบ่ฏๆฅ่ฏข็ปๆ", "htmlMessage": message }); | |
| }, reason => { | |
| message = "</br></br>๐ ๆฅ่ฏข่ถ ๆถ" | |
| message = `<p style="text-align: center; font-family: -apple-system; font-size: large; font-weight: bold;">` + message + `</p>` | |
| $done({ "title": "๐ IP ๆฌบ่ฏๆฅ่ฏข็ปๆ", "htmlMessage": message }); | |
| }) | |
| }, reason => { | |
| message = "</br></br>๐ ๆฅ่ฏข่ถ ๆถ" | |
| message = `<p style="text-align: center; font-family: -apple-system; font-size: large; font-weight: bold;">` + message + `</p>` | |
| $done({ "title": "๐ IP ๆฌบ่ฏๆฅ่ฏข็ปๆ", "htmlMessage": message }); | |
| }) | |
| function json2info(cnt, paras) { | |
| var res = "------------------------------" | |
| cnt = JSON.parse(cnt) | |
| for (i = 0; i < paras.length; i++) { | |
| cnt[paras[i]] = paras[i] == "country_code" ? cnt[paras[i]] + " โฆ" + flags.get(cnt[paras[i]].toUpperCase()) + "โง" : cnt[paras[i]] | |
| res = cnt[paras[i]] ? res + "</br><b>" + "<font color=>" + paran[i] + "</font> : " + "</b>" + "<font color=>" + cnt[paras[i]] + "</font></br>" : res | |
| } | |
| // res =res+ "------------------------------"+"</br>"+"<font color=#6959CD>"+"<b>่็น</b> โ " + $environment.params+ "</font>" | |
| // res = `<p style="text-align: center; font-family: -apple-system; font-size: large; font-weight: thin">` + res + `</p>` | |
| return res | |
| } | |
| function Display(cnt) { | |
| let score = cnt.indexOf(`"score":`) != -1 ? cnt.split(`"score":`)[1].split("\n")[0] : "NA" | |
| score = "</br><b>" + "<font color=>" + "ๆฌบ่ฏๆๆฐ " + "</font> : " + "</b>" + "<font color=>" + score.replace(/"|,/g, "") + "</font></br>" | |
| let risk = cnt.indexOf(`"risk":`) != -1 ? cnt.split(`"risk":`)[1].split("\n")[0] : "NA" | |
| risk = "</br><b>" + "<font color=>" + "้ฃ้ฉ็ญ็บง " + "</font> : " + "</b>" + "<font color=>" + E2C(risk.replace(/"|,/g, "")) + "</font></br>" | |
| return (score + risk) | |
| } | |
| //ๆ้ซ้ฃ้ฉโผ๏ธใ้ซ้ฃ้ฉโ ๏ธ ๅ ไธญ้ฃ้ฉ๐ก ไฝ้ฃ้ฉโ | |
| function E2C(cnt) { | |
| res = "NA" | |
| if (cnt.indexOf("very high") != -1) { | |
| res = "ๆ้ซ้ฃ้ฉ โผ๏ธ" | |
| } else if (cnt.indexOf("high") != -1) { | |
| res = "้ซ้ฃ้ฉ โ ๏ธ" | |
| } else if (cnt.indexOf("medium") != -1) { | |
| res = "ไธญ้ฃ้ฉ ๐ก" | |
| } else if (cnt.indexOf("low") != -1) { | |
| res = "ไฝ้ฃ้ฉ โ " | |
| } | |
| return res | |
| } | |
| var flags = new Map([["AC", "๐ฆ๐จ"], ["AE", "๐ฆ๐ช"], ["AF", "๐ฆ๐ซ"], ["AI", "๐ฆ๐ฎ"], ["AL", "๐ฆ๐ฑ"], ["AM", "๐ฆ๐ฒ"], ["AQ", "๐ฆ๐ถ"], ["AR", "๐ฆ๐ท"], ["AS", "๐ฆ๐ธ"], ["AT", "๐ฆ๐น"], ["AU", "๐ฆ๐บ"], ["AW", "๐ฆ๐ผ"], ["AX", "๐ฆ๐ฝ"], ["AZ", "๐ฆ๐ฟ"], ["BA", "๐ง๐ฆ"], ["BB", "๐ง๐ง"], ["BD", "๐ง๐ฉ"], ["BE", "๐ง๐ช"], ["BF", "๐ง๐ซ"], ["BG", "๐ง๐ฌ"], ["BH", "๐ง๐ญ"], ["BI", "๐ง๐ฎ"], ["BJ", "๐ง๐ฏ"], ["BM", "๐ง๐ฒ"], ["BN", "๐ง๐ณ"], ["BO", "๐ง๐ด"], ["BR", "๐ง๐ท"], ["BS", "๐ง๐ธ"], ["BT", "๐ง๐น"], ["BV", "๐ง๐ป"], ["BW", "๐ง๐ผ"], ["BY", "๐ง๐พ"], ["BZ", "๐ง๐ฟ"], ["CA", "๐จ๐ฆ"], ["CF", "๐จ๐ซ"], ["CH", "๐จ๐ญ"], ["CK", "๐จ๐ฐ"], ["CL", "๐จ๐ฑ"], ["CM", "๐จ๐ฒ"], ["CN", "๐จ๐ณ"], ["CO", "๐จ๐ด"], ["CP", "๐จ๐ต"], ["CR", "๐จ๐ท"], ["CU", "๐จ๐บ"], ["CV", "๐จ๐ป"], ["CW", "๐จ๐ผ"], ["CX", "๐จ๐ฝ"], ["CY", "๐จ๐พ"], ["CZ", "๐จ๐ฟ"], ["DE", "๐ฉ๐ช"], ["DG", "๐ฉ๐ฌ"], ["DJ", "๐ฉ๐ฏ"], ["DK", "๐ฉ๐ฐ"], ["DM", "๐ฉ๐ฒ"], ["DO", "๐ฉ๐ด"], ["DZ", "๐ฉ๐ฟ"], ["EA", "๐ช๐ฆ"], ["EC", "๐ช๐จ"], ["EE", "๐ช๐ช"], ["EG", "๐ช๐ฌ"], ["EH", "๐ช๐ญ"], ["ER", "๐ช๐ท"], ["ES", "๐ช๐ธ"], ["ET", "๐ช๐น"], ["EU", "๐ช๐บ"], ["FI", "๐ซ๐ฎ"], ["FJ", "๐ซ๐ฏ"], ["FK", "๐ซ๐ฐ"], ["FM", "๐ซ๐ฒ"], ["FO", "๐ซ๐ด"], ["FR", "๐ซ๐ท"], ["GA", "๐ฌ๐ฆ"], ["GB", "๐ฌ๐ง"], ["HK", "๐ญ๐ฐ"], ["HU", "๐ญ๐บ"], ["ID", "๐ฎ๐ฉ"], ["IE", "๐ฎ๐ช"], ["IL", "๐ฎ๐ฑ"], ["IM", "๐ฎ๐ฒ"], ["IN", "๐ฎ๐ณ"], ["IS", "๐ฎ๐ธ"], ["IT", "๐ฎ๐น"], ["JP", "๐ฏ๐ต"], ["KR", "๐ฐ๐ท"], ["LU", "๐ฑ๐บ"], ["MO", "๐ฒ๐ด"], ["MX", "๐ฒ๐ฝ"], ["MY", "๐ฒ๐พ"], ["NL", "๐ณ๐ฑ"], ["PH", "๐ต๐ญ"], ["RO", "๐ท๐ด"], ["RS", "๐ท๐ธ"], ["RU", "๐ท๐บ"], ["RW", "๐ท๐ผ"], ["SA", "๐ธ๐ฆ"], ["SB", "๐ธ๐ง"], ["SC", "๐ธ๐จ"], ["SD", "๐ธ๐ฉ"], ["SE", "๐ธ๐ช"], ["SG", "๐ธ๐ฌ"], ["TH", "๐น๐ญ"], ["TN", "๐น๐ณ"], ["TO", "๐น๐ด"], ["TR", "๐น๐ท"], ["TV", "๐น๐ป"], ["TW", "๐จ๐ณ"], ["UK", "๐ฌ๐ง"], ["UM", "๐บ๐ฒ"], ["US", "๐บ๐ธ"], ["UY", "๐บ๐พ"], ["UZ", "๐บ๐ฟ"], ["VA", "๐ป๐ฆ"], ["VE", "๐ป๐ช"], ["VG", "๐ป๐ฌ"], ["VI", "๐ป๐ฎ"], ["VN", "๐ป๐ณ"], ["ZA", "๐ฟ๐ฆ"]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment