dms-scrape 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +70 -0
- package/package.json +9 -5
- package/.gitattributes +0 -2
- package/.vscode/launch.json +0 -18
- package/dms-scrape.d.ts +0 -1
- package/extractfrombrowser.js +0 -12
- package/index.mjs +0 -50
- package/lib/array2String.mjs +0 -5
- package/lib/determineCategory.mjs +0 -18
- package/lib/filterContent.mjs +0 -34
- package/lib/processHTML.mjs +0 -50
- package/lib/sources.mjs +0 -52
- package/sources/T1/CTEE.mjs +0 -32
- package/sources/T1/DIGITIMES.mjs +0 -23
- package/sources/T1/UDNMoney.mjs +0 -46
- package/sources/T2/CHINATIMES.mjs +0 -43
- package/sources/T2/LTN3C.mjs +0 -34
- package/sources/T2/LTNEC.mjs +0 -40
- package/sources/T2/NXTAPPLE.mjs +0 -30
- package/sources/T2/UDN.mjs +0 -26
- package/sources/T3/SETN.mjs +0 -35
- package/sources/T4/CNA.mjs +0 -33
- package/sources/T4/ETDAY.mjs +0 -39
- package/sources/T4/TAISOUNDS.mjs +0 -21
- package/sources/T5/CNYES.mjs +0 -25
- package/sources/T5/COMPOTECHASIA.mjs +0 -30
- package/sources/T5/COOL3C.mjs +0 -26
- package/sources/T5/EPRICE.mjs +0 -19
- package/sources/T5/INSIDE.mjs +0 -15
- package/sources/T5/KOCPC.mjs +0 -28
- package/sources/T5/MASHDIGI.mjs +0 -27
- package/sources/T5/SAYDIGI.mjs +0 -22
- package/sources/T5/SOGI.mjs +0 -46
- package/sources/T5/TECHBANG.mjs +0 -20
- package/sources/T5/TECHNEWS.mjs +0 -17
- package/sources/T5/TECHORANGE.mjs +0 -26
- package/sources/T5/XF.mjs +0 -28
- package/test/cnyestest.js +0 -814
- package/test/compotechtest.js +0 -561
- package/test/insidetest.js +0 -1399
- package/test/saydigitest.js +0 -1000
- package/test/techbangtest.js +0 -1109
- package/test/techrangetest.js +0 -3101
- package/test/tested/chinatest.js +0 -4761
- package/test/tested/cteetest.js +0 -1406
- package/test/tested/digitest.js +0 -1664
- package/test/tested/digitimes3.html +0 -2598
- package/test/tested/digitimes4.html +0 -2614
- package/test/tested/nextapple.js +0 -1546
- package/test/tested/setntest.js +0 -2728
- package/test.mjs +0 -108
package/test.mjs
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { dmsScrape } from "./index.mjs";
|
|
2
|
-
import * as cheerio from "cheerio"
|
|
3
|
-
import { cteetest } from "./test/tested/cteetest.js";
|
|
4
|
-
import { DIGITIMES } from "./sources/T1/DIGITIMES.mjs";
|
|
5
|
-
import { digitest } from "./test/tested/digitest.js";
|
|
6
|
-
import { chinatest } from "./test/tested/chinatest.js";
|
|
7
|
-
import { CHINATIMES } from "./sources/T2/CHINATIMES.mjs";
|
|
8
|
-
import { NXTAPPLE } from "./sources/T2/NXTAPPLE.mjs";
|
|
9
|
-
import { SETN } from "./sources/T3/SETN.mjs";
|
|
10
|
-
import { setntest } from "./test/tested/setntest.js";
|
|
11
|
-
import { techorangetest } from "./test/techrangetest.js";
|
|
12
|
-
import { TECHORANGE } from "./sources/T5/TECHORANGE.mjs";
|
|
13
|
-
import { TECHBANG } from "./sources/T5/TECHBANG.mjs";
|
|
14
|
-
import { techbangtest } from "./test/techbangtest.js";
|
|
15
|
-
import { CNYES } from "./sources/T5/CNYES.mjs";
|
|
16
|
-
import { cnyestest } from "./test/cnyestest.js";
|
|
17
|
-
import { SAYDIGI } from "./sources/T5/SAYDIGI.mjs";
|
|
18
|
-
import { saydigitest } from "./test/saydigitest.js";
|
|
19
|
-
import { COMPOTECHASIA } from "./sources/T5/COMPOTECHASIA.mjs";
|
|
20
|
-
import { compotechtest } from "./test/compotechtest.js";
|
|
21
|
-
import { INSIDE } from "./sources/T5/INSIDE.mjs";
|
|
22
|
-
import { insidetest } from "./test/insidetest.js";
|
|
23
|
-
const testLinks = [
|
|
24
|
-
"https://www.cool3c.com/article/202079",
|
|
25
|
-
|
|
26
|
-
"https://www.kocpc.com.tw/archives/563640",
|
|
27
|
-
"https://mashdigi.com/qualcomm-continues-to-launch-the-snapdragon-x-plus-processor-composed-of-8-sets-of-performance-cores-expanding-the-copilot-pc-product-lineup/",
|
|
28
|
-
"https://www.sogi.com.tw/articles/samsung_galaxy_s25_ultra/6262880",
|
|
29
|
-
"https://technews.tw/2024/09/12/snapdragon-8-gen-4-and-dimensity-9400-configuration-unveiled/",
|
|
30
|
-
"https://www.xfastest.com/thread-291944-1-1.html",
|
|
31
|
-
"https://www.ettoday.net/news/20240905/2810968.htm",
|
|
32
|
-
"https://udn.com/news/story/7240/8145957",
|
|
33
|
-
"https://money.udn.com/money/story/5613/8231957",
|
|
34
|
-
"https://3c.ltn.com.tw/news/59270",
|
|
35
|
-
"https://ec.ltn.com.tw/article/breakingnews/4790282",
|
|
36
|
-
"https://www.digitimes.com.tw/tech/dt/n/shwnws.asp?id=0000700414_DTZ3HLET2I9D7N38H02NN",
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
const buggedLinks = ["https://www.eprice.com.tw/mobile/talk/4523/5811558/1/"];
|
|
40
|
-
const testLink = [
|
|
41
|
-
"https://money.udn.com/money/story/5612/8219989",
|
|
42
|
-
];
|
|
43
|
-
// async function getTestLinks() {
|
|
44
|
-
// var response = [];
|
|
45
|
-
// for (const link of testLink) {
|
|
46
|
-
// response.push(await dmsScrape("link", link));
|
|
47
|
-
// // response = await fetch(link);
|
|
48
|
-
// }
|
|
49
|
-
// // return await response.text();
|
|
50
|
-
// return response;
|
|
51
|
-
// }
|
|
52
|
-
|
|
53
|
-
// console.log(await getTestLinks());
|
|
54
|
-
|
|
55
|
-
// console.log(await dmsScrape("html", "https://www.setn.com/News.aspx?NewsID=1526574", setntest))
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// console.log(await dmsScrape("html", "https://buzzorange.com/techorange/2024/10/03/eu-plans-to-hit-china-based-ev-makers-with-additional-tariffs/", techorangetest))
|
|
64
|
-
|
|
65
|
-
// const $ = cheerio.load(chinatest)
|
|
66
|
-
// console.log(CHINATIMES($))
|
|
67
|
-
|
|
68
|
-
// const inithtml = await (await fetch("https://www.inside.com.tw/article/36326-meta-announces-300-quest-3s-a-cheaper")).text()
|
|
69
|
-
|
|
70
|
-
// let $ = cheerio.load(await (await fetch("https://www.inside.com.tw/article/36326-meta-announces-300-quest-3s-a-cheaper")).text())
|
|
71
|
-
// $('script, style, link').remove();
|
|
72
|
-
// let cleanedHTML = $.html();
|
|
73
|
-
// console.log(cleanedHTML)
|
|
74
|
-
|
|
75
|
-
// console.log(NXTAPPLE(cheerio.load(cleanedHTML)))
|
|
76
|
-
// ${
|
|
77
|
-
// console.log(CNYES(cheerio.load(cnyestest)))
|
|
78
|
-
// console.log(SAYDIGI(cheerio.load(saydigitest)))
|
|
79
|
-
// console.log(await dmsScrape("link", "https://www.compotechasia.com/a/press/2024/0919/58658.html"))
|
|
80
|
-
|
|
81
|
-
//seriosu bug: https://www.xfastest.com/thread-292861-1-1.html
|
|
82
|
-
// bug title: https://www.eprice.com.tw/mobile/talk/6113/5812708/1
|
|
83
|
-
//unwanted content: https://www.sogi.com.tw/articles/realme_13_pro_plus/6263085
|
|
84
|
-
/// undefined: https://www.digitimes.com.tw/tech/dt/n/shwnws.asp?cnlid=1&id=0000703998_EAN8YJ9ZLL4AQU7Z9IWZT
|
|
85
|
-
// const urls = ["https://www.xfastest.com/thread-292892-1-1.html", "https://www.cool3c.com/article/225948" , "https://tw.nextapple.com/finance/20241002/F46EF42772FDB0898B925982A2D4F7D3" ]
|
|
86
|
-
// for (const url of urls) {
|
|
87
|
-
// await multscrape(url);
|
|
88
|
-
// }
|
|
89
|
-
|
|
90
|
-
/// sogi promotion: https://www.sogi.com.tw/articles/samsung_galaxy_tab_s10_ultra/6263080
|
|
91
|
-
// eprice title: https://www.eprice.com.tw/mobile/talk/102/5812686/1
|
|
92
|
-
///bug: https://www.cool3c.com/article/226021
|
|
93
|
-
// multscrape("https://3c.ltn.com.tw/news/59704")
|
|
94
|
-
|
|
95
|
-
// async function multscrape(url) {
|
|
96
|
-
// const data = await dmsScrape("link", url);
|
|
97
|
-
// console.log(data.title);
|
|
98
|
-
// console.log(data.date + ' / ' + data.source + ' / ' + data.author);
|
|
99
|
-
// console.log(data.url);
|
|
100
|
-
// console.log(data.content);
|
|
101
|
-
// }
|
|
102
|
-
// console.log(COMPOTECHASIA(cheerio.load(compotechtest)))
|
|
103
|
-
// console.log(INSIDE(cheerio.load(insidetest)))
|
|
104
|
-
|
|
105
|
-
console.log(await dmsScrape("html", "https://www.chinatimes.com/realtimenews/20240904005289-260410?chdtv", chinatest))
|
|
106
|
-
// const link = "https://www.chinatimes.com/newspapers/20240820000224-260204?chdtv"
|
|
107
|
-
// const check = "https://www.chinatimes"
|
|
108
|
-
// console.log(link.startsWith(check))
|