windowdog 1 month ago
parent
commit
f363bf0b74
1 changed files with 133 additions and 0 deletions
  1. 133 0
      src/code/tamper_listen_filter_pump_token_gmgn.js

+ 133 - 0
src/code/tamper_listen_filter_pump_token_gmgn.js

@@ -0,0 +1,133 @@
+// ==UserScript==
+// @name         get_filter_pump_token_gmgn
+// @namespace    http://tampermonkey.net/
+// @version      2025-02-16
+// @description  try to take over the world!
+// @author       You
+// @match        https://gmgn.ai/meme/9Z7Wz20p?chain=sol&tab=complete*
+// @icon         https://www.google.com/s2/favicons?sz=64&domain=gmgn.ai
+// @grant        none
+// ==/UserScript==
+
+
+// https://gmgn.ai/meme/9Z7Wz20p?chain=sol
+// https://gmgn.ai/meme/9Z7Wz20p?chain=sol&tab=complete
+
+
+function funcDownload(content, filename) {
+    console.log('begin download');
+    // 创建隐藏的可下载链接
+    let eleLink = document.createElement('a');
+    eleLink.download = filename;
+    eleLink.style.display = 'none';
+    // 字符内容转变成blob地址
+    let blob = new Blob([content]);
+    eleLink.href = URL.createObjectURL(blob);
+    // 触发点击
+    document.body.appendChild(eleLink);
+    eleLink.click();
+    // 然后移除
+    document.body.removeChild(eleLink);
+}
+
+
+function sleep(sleepdelay) {
+    return new Promise((resolve, reject) => {
+        setTimeout(() => {
+            resolve(sleepdelay);
+        }, sleepdelay);
+    })
+}
+
+
+let tbody = document.querySelector('#__next > div > div > main > div.css-xe3de5 > div.css-b0bdxf > div > div > div > div > div.g-table-tbody-virtual.g-table-tbody > div.g-table-tbody-virtual-holder > div > div')
+let arr_token_row = Array.from(tbody.children);
+let arr_res_data = [];
+// let arr_title = ['token_url', 'token_name', 'age', 'liq/initial', 'mc', 'holders', '24h txs', '24h vol', 'price', '1m%', '5m%', '1h%', 'degen audit', 'dev'];
+
+let arr_title = ['token_url', 'token_name', 'age', 'liq/initial', 'mc', 'holders', 'nomint', 'blacklist', 'burnt', 'top 10', 'insiders', 'dev'];
+
+
+
+function save_resdata() {
+    console.log("enter save_resdata");
+    arr_res_data.forEach((val, index, arr) => { arr[index] = val.join() + "\n" });
+
+    funcDownload(res_data.join(""), "gmgn_pump_" + parseInt(Date.now() / 1000) + ".csv");
+    arr_res_data = [];
+
+}
+
+for (let idx = 0; idx < arr_token_row.length; idx++) {
+    let arr_cur = [];
+    let arr_td = Array.from(arr_token_row[idx].children);
+    for (let idx2 = 0; idx2 < arr_td.length; idx2++) {
+        if (idx2 == 0) {
+            // Token
+            let a_ele = arr_td[idx2].querySelector('a');
+            // arr_cur.push(arr_td[idx2].querySelector('a').href);
+            let url_ = a_ele.href;
+            let title = a_ele.querySelector('[title]').getAttribute('title');
+            // title = "RONASZN"
+            arr_cur.push(url_);
+            arr_cur.push(title);
+
+
+        }
+        else if (idx2 == 1) {
+            // Age
+            arr_cur.push(arr_td[idx2].innerText);
+        }
+        else if (idx2 == 2) {
+            // Liq /initial
+
+        }
+        else if (idx2 == 3) {
+            //  MC  
+            arr_cur.push(arr_td[idx2].innerText);
+        }
+        else if (idx2 == 4) {
+            // holders
+            arr_cur.push(arr_td[idx2].innerText);
+        }
+        else if (idx2 == 5) {
+            // 24txns
+
+        }
+        else if (idx2 == 6) {
+            // 24vol
+
+        }
+        else if (idx2 == 7) {
+            // price
+
+        } else if (idx2 == 8) {
+            // 1m%
+        }
+        else if (idx2 == 9) {
+            // 5m%
+
+        }
+        else if (idx2 == 10) {
+            // 1h%
+
+        } else if (idx2 == 11) {
+            // degen audit
+
+            //  'nomint', 'blacklist', 'burnt', 'top 10', 'insiders' 
+
+            let arr_ = arr_td[idx2].innerText.split(/\s+/);
+            arr_cur.push(arr_[0]);
+            arr_cur.push(arr_[2]);
+            arr_cur.push(arr_[4]);
+            arr_cur.push(arr_[6]);
+            arr_cur.push(arr_[9]);
+        } else if (idx2 == 12) {
+            // dev
+            arr_cur.push(arr_td[idx2].innerText.trim().replace(/[\n-]+/g, '-'));
+        }
+
+    }
+    arr_res_data.push(arr_cur);
+
+}